+ Start a Discussion
Amit Singh.ax1042Amit Singh.ax1042 

After clicking on Approve Button (Custom),Record Should not be available for Editing...

I have taken one custom button "Approve" on my detail page. When i click on Approve button then i want to copy some field from that record into another object.

The another requirement is that after clicking on Approve button that particular record should not be available for editing.


How to do this?


The first requriement can be met by creating a custom button and using Ajax Toolkit to call apex code from the javascript. You can follow the Ajax tool kit guide.


The secod requirement is complicated. You cannot modify the sharing rules on record basis. However, the quickest soluton that just came into my mind is that clone the object detail page using a visualforce page. Create a checkbox on that obejct say "Is Not Available". On the button click set this checkbox and on the page load check this field's value and do the redirection.


This is a bit complicated but I hope it helps.



Amit Singh.ax1042Amit Singh.ax1042

could you please help me in writing code for the first requirement...??

say an object Quote is there in thisfolloing fields are there...

Name (Text)


Date (Date)

and Approve is a custom button on this

whenever Approve is clicked all the date is copied to Estimate(Estimate is an object which fields are Same as Quote object's fields)...