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
CloudyJoshCloudyJosh 

Copy info between different fields on the Account page?

So lets say I have a billing name / shipping name on the account page, and I want to be able to copy the info from the billing name field to the shipping name field, and vie versa with a click of a button, so the user doesn't have to reenter everything, how can this be done?

Cliff:
Two forms on the account page, billing and shipping name
I need to copy billing name to shipping name, and vice versa
I need this done with a click of a button (there will be 2 buttons)

Any help is appreciated!

piyush sfpiyush sf
Hi Josh,
   Following approaches can be taken
1. We can populate using trigger/ Workflow.
2. We can use custom button to do the same on detail page.
3. If there is a custom page, we can use javascript/apex to do the same.

Thanks
Piyush
sfpiyush@gmail.com
CloudyJoshCloudyJosh
This will be on the account detail page, so a custom button would work. How would I do this? I'm very new to SaleForce.
piyush sfpiyush sf
Hi,
  Please find sample to be used :
  
    Behavior: Execute JavaScript
    {!REQUIRESCRIPT("/soap/ajax/26.0/connection.js")} 

    var c = new sforce.SObject("Account"); 
    c.id = "{!Account.Id}";
    result = sforce.connection.update([c]); 

    window.location.reload();
    
    
    If you require salesforce support, please get in touch at sfpiyush@gmail.com
    
Thanks
sfpiyush@gmail.com

 
CloudyJoshCloudyJosh
I tried to copy that to the form underneath and used "on click Javascript", but when I add the custom link to the layout, it says "unexpected identifier", can anyone help me with this? I want to be able to click the button and the info gets copied from "Billing" to "Shipping" or vice versa.

Thanks!