[SalesForce] Clone Account without cloning opportunities

I am testing out cloning an account, but I would like the system to not clone some to the objects/fields. For example, I would like the clone button to clone the Address, phone and other info but not the Name. I would also like the clone to not clone the opportunities either, as currently the opportunities are auto populated for each location when the account is created. How can I do this? I have followed these steps as outline in the article: https://success.salesforce.com/answers?id=90630000000gr6CAAQ.

Help would be greatly appreciated.

Best Answer

For what you would like, there is simple way I can see you doing this. On your button you can set your values via the URL and salesforce will map them to their correct field as long as you match the input field id.

Note: Depending on the amount of work this will probably be the simplest way of achieving this goal

Example Button (Clearing out values from account to clone from):

Behavior: Execute Javascript

Content Source: OnClick Javascript

var url = '{!Account.Id}/e?clone=1&Name=&Phone=';

window.location.href = url; 

Note: Custom fields will have an Id while standard fields do not when referencing them as shown via the example button on top.

The other way you can approach this is populating the values head of time of what you want to copy.

Example Button (Setting specific values from account you want to clone from):

Behavior: Execute Javascript

Content Source: OnClick Javascript

var url = '001/e?Phone={!Account.Phone}&Type={!Account.Type}';

window.location.href = url; 

Note: Custom fields will have an Id while standard fields do not when referencing them as shown via the example button on top.