+ Start a Discussion
sf_johnsf_john 

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.
TCAdminTCAdmin
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.