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

Populate fields with s-control

I need help creating an S-control to do the following.  I have a custom object 4 layers down from Accounts.  I have created a contact lookup field here, but need to be able to display contact details such as phone and email address as well in a custom report.
I thought about recreating the fields I need on my new custom object, and would like some tips on creating an S-Control that will populate these fields when the user selects the contact from the lookup.
Hello John,

There is a hundred ways to do almost everything but this shouldn't be too hard to do.  Your sControl will probably be an inline which will trigger when the Contact field is updated.  It will do a query to the contact object using the Contact ID on the custom object.  It can then create a temp custom object, the one you are working on, and populate the ID and the contact fields you queried.  Then save the record.

The issue you have with these inline sControls is that the fields populate on the screen and then the sControl runs.  Since the fields are already on the page, blank, they will not display until you refresh the screen.  This can also be done through the sControl.

If you need assistance, please let me know.