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
vasvas 

custom button/link to copy data from one field to another

I want to add a custom button or a link on the account detail page which, when clicked, simply copies billing address to shipping address and saves the record. How can I do that? Pls provide the code if possible. Thanks in advance.
abhi_developerabhi_developer

Hey vas,

Try this, write a class with a copy function which does the task of copying between fields.

Now write a trigger (before insert) to save the record which calls the copy function of the class u have written.

Have a look at page 15, 16, 17 in "salesforce_apex_language_reference.pdf" if u have,

there is a nice example of appending world to hello feild before saving.

Do reply if works.

-Abhishek Singh