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

Inline S-Control

I'm looking for a way to update an Opportunity (calculate something and update some fields) whenever an Opportunity was modified.
Is there a way to implement an s-ontrol that does this and attach it to the opportunity? I heard something about inline s-controls but couldn't figure out if that's what I need.

I know that I can do that with triggers (appex code) but I would like to use an s-control.

Can someone helpe me?
You can easily create an in-line S-control. Just have it display the information out onto the HTML section, and under the layout drag the S-control itself to the page. Edit the properties so that it has a height of 20 or so (whatever looks right), and be sure to check "Show Label"
Doug ACFDoug ACF
There are a few ways to do this.  Depending on your requirements, perhaps the simplest would be a workflow field update (assuming you have EE, all of the fields that go into your calculation are on the same object record, and you can get your calculation done in a SFDC formula).  If that won't work, then an Apex Trigger would be best - again if you have EE.  But it sounds like you don't want a trigger, so you could use an inline S-Control.  One of the downsides of an in-line S-Control is that it runs on the browser side as part of every display of the view page (not just on the server side when someone updates the record like workflow rules & triggers).  You'd need to decide whether you just want the output of your calculation to just appear in an HTML block on the page and not saved in the database or if you really need to update an Opp record field with it, so its available for reporting.