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
wmpDevwmpDev 

Trigger s-control

Hello,

I’m trying to transfer field values from Opportunities page to custom object using s-control.  I got the s-control part figured out, but how can I trigger it when a user enters new value into a field or updates it???  I would like to avoid using custom button….

 Thank you,

Dan


mpkmpk

...Yes -- I need to do this too (and, as a total newbie, haven't even tackled the s-control bit yet).  Ideally, I'd like to trigger on things like text-field completion (as when you're configuring a new user, and the Email field gets automatically copied into the Username field) or, more importantly, when dropdowns are adjusted.

Hopefully, this is possible...?

HarmpieHarmpie
At this moment it is impossible to do what you want in a decent way (to my knowledge). Once APEX goes live, you can handle this with a trigger on the opportunity object, executing your s-control, or manipulating your custom object using APEX it self.

To circumvent the problem now you have several options, all of which are kinda ugly :
1) Using a custom link on the opportunity detail page, which should be clicked manually to trigger your logic (s-control).
2) Overriding the 'new' and 'edit' buttons and put your own logic behind them (s-control).

If someone else does know a way to create this functionality, please reply, since I would love to use it myself as well :smileywink:

Always ThinkinAlways Thinkin
I don't know if this would work, but I'm going to be trying something similar myself:

Have an inline script that checks the value of a field and if it meets the conditions you want, it triggers the action you want.

For my needs this is simpler, I'm looking to create a Case when an Opportunity's Stage is set to Closed Won, so it's just one simple check. It would be far harder if the contents of the field can be anything. I wonder whether you could check the field's last modified time and fire the script if it's in the last minute. I'm not sure whether mod times are exposed in the API, never looked.

I'll post whether my simple plan works.


HarmpieHarmpie
You're right, I forgot the option of an inline script, which shuold work just fine.
 
If you use field history tracking on the field in question, you can access this from the API, so I think you're on the right track.