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
VDubVDub 

Opportunity Trigger to Initiate Custom Button

Hi,

I've only created one trigger so I'm new to it.  I've created a custom button that fills out a form based on information from an opportunity.
I would like to create a trigger that initiates the custom button when a certain type of opportunity is saved.  
I need to use the custom button id to trigger the form
I've searched the boards but I can't find any sample code to go by.  I don't even know if this is possible.
This is what I've got so far and don't know where to go from here.

trigger ProEdgeFormTrigger on Opportunity (after update) {
for (Opportunity o : Trigger.new) {
if (o.Type == 'ProEdge')
   
    }
}

Any help would be greatly appreciated.  Thanks, Vanessa

Ankit Gupta@ DeveloperAnkit Gupta@ Developer
Hi Vanessa,

you can acehive the by two ways :

1. You need to override the opportunity page if you want to show or hide the custom button on page.

2. you can also creat the record type on opportunity object and set the page layout according the record type and you can also set the cutom button on page layout .
VDubVDub
Hi,

I just decided to create a static message in a VF page on the Opportunites page.

Thanks, Vanessa