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

Auto populating a custom field using Scontrol

Hi All,
I have a custom field in my Contact object page.On associating the contact to an account,my custom field should get populated automatically with a value associated to my account.I am able to populate my custom field,but i have done it through an Scontrol(invoked by a button) which redirects to a new URL and then populate the field.
But i have found that my requirement is already implemented in the Case object page of SFDC.While creating a new case,the account field is automatically populated when the case is associated to a contact(not in a new page).
Can anyone provide some guidelines on how this is done ?This would help me to solve my issue..
Thanks in advance,
Did you figure out how to do that yet?  WE are pretty basic users, and would like an s-control to auto populate data into a contact custom field from the associate account.  Once that is done, then we would like to auto populate data from a contact into the associated oppertunity.   Any help would be much appreciated.
It sounds like you are looking for a way to auto-populate the Contact field while in edit mode? If this is the case, you are out of luck. According to what I have found through experience and other posts, the edit page automation can only be done with built-in Salesforce functionality. If you want the field to autopopulate on save, then you can set up a workflow to initiate the field update (if achievable through a formula field) or Apex through a trigger.

One thing to keep in mind, however (and this advice cannot be credited to me) is that duplication of data, while it may seem to make some things easier, is rarely a good idea. If the values change on one of the objects, you must also enforce the same logic on the duplicated data to enforce data integrity.

For more information on this topic (in a similar post of yours) please check out the link below as it is better explained there (check out the administrator's comments):

Populating a Custom Field


Thanks for the reply.But i am able to populate the fields in edit page through my Scontrol.My problem is that currently i am invoking the scontrol on click of a button.

ie:When i am clicking a button on the page,my Scontrol opens a new page autopopulating the custom field.But i want this to happen only when the user enters value for the account field .

How can i invoke my Scontrol in this case?

Thanks ,