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
carbettycarbetty 

Custom Button

Hi,

 

I am hoping that someone might be able to help me with a simple Custom Button.  I have built this in the past but for the life of me can't figure out the code that I started with.

 

Fairly straightforward...

 

I have an Opportunity Record Type A and an Opportunity Record Type B.

 

On A, I would like a button that says 'Accept Opp'.  The underlying code should simply convert it to record type B - carrying over all current data.

 

Will you take pity on a kind non-developer soul?

 

Thanks in advance!

Best Answer chosen by Admin (Salesforce Developers) 
SurekaSureka

Hi,

 

Create a custom button and place it in the detail page of Opp Record Type A.

 

Override the custon button with this url - /{!Opportunity.Id}/e?retURL=%2F{!Opportunity.Id}&RecordType=012800000003a2F 

 

where  '012800000003a2F' is the Id of Record Type B.

 

Hope this helps.

 

Thanks 

All Answers

SurekaSureka

Hi,

 

Create a custom button and place it in the detail page of Opp Record Type A.

 

Override the custon button with this url - /{!Opportunity.Id}/e?retURL=%2F{!Opportunity.Id}&RecordType=012800000003a2F 

 

where  '012800000003a2F' is the Id of Record Type B.

 

Hope this helps.

 

Thanks 

This was selected as the best answer
SteveBowerSteveBower

I think you also want to append "&save=1" otherwise it just leaves you in the edit screen,  Best, Steve.

carbettycarbetty

Thank you to both of you!  This is exactly what I was looking for.

 

Have a great day!