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
sami amisami ami 

Custom button invoked when status is changed.

I have a custom button which does some functionality when clicked.I want that click to happen automatically when the status is changed to closed.

 

My thoughts:

 

1.Thought of some trigger which will fire when status is changed to closed.But not sure how invoke that button which is on detail page.

 

2.Overriding save button.But status is closed then call my apex class(that is what button does now and generates a PDF)

Not sure how to implement them.Any suggestions or new ideas??

 

 

karthiksaivkarthiksaiv

Hi,

 

i'have an idea.

whatever the code you have in that custom button, write in after save trigger which will do the required functionality.

sami amisami ami
Thanks karthik.
Did you meant after insert,afeter update trigger?
My Url is something like this.
How can get that?

/apex/testclass?eid={!Customobject.Id}&accountId={!Customobject.AccountId__c}&sessionId={!$Api.Session_ID}&contactid={!Customobject.ContactId__c}