function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
teknicsandteknicsand 

Using workflow to trigger s-control

Can I use workflow rules to trigger a snippet s-control? I need the s-control to trigger when the field stages in the opportunity tab are changed from one value to another. I know triggers as such cannot be implement by code on the client side, so I'm wondering if workflow can achieve this. OR if it can't, is there a workaround or a hack to trigger the scontrol based on changes in values of a field.
Any ideas??

Thanks

-sand
werewolfwerewolf
Have you considered using an Apex trigger?  That sounds like what you're really looking for.
teknicsandteknicsand
I have read about the use of triggers for cases like this. But I was hoping if there was a hack to get it done with just s-controls. Probably another workaround could be having a button and display it only a certain condition is met, and then have the user click on the button. It kind of defeats the purpose of automating the purpose, but I can't think of anything else.

-sand
werewolfwerewolf
Why would you want to put in a hack when you can solve the problem definitively with a trigger?
Greg HGreg H
I do understand why werewolf would recommend using an actual Apex trigger but I can think of use cases where an sControl is best suited.
 
For example I recently built an sControl and workflow rule to display a message to users on the Opportunity detail page. The message was an inline sControl that reminded the user to verify a specific field when they updated the opportunity stage. And the message would display every time the detail page was accessed until the user literally clicked a "I validated this" button.  The solution was best suited by a workflow rule where a field update was done if a specific condition was met and the inline sControl was necessary to handle the confirmation of the action once the user received the message.
 
Anyway, my point is that you can coordinate sControls with workflow depending on the business need.
-greg