+ Start a Discussion

Change the access to filed once custom buttom is clicked


I'm working on a requirement, where sales users can edit the field until users from other profile click the custom buttom called "approved to legal", once the button is clicked, sales users can no more edit the field (read only). 


I appreciate your ideas .......




Rajesh ShahRajesh Shah
You can have to record types and 2 corresponding page layouts. In 1 page layout, define the field as editable while in other define it as read only. When the user clicks on Approved to Legal, change the record type which would change the page layout. The field would then be read only.

Thanks rajesh, but how to make it dynamic, ie " when user clicks the buttoin" how should i capture?..



Rajesh ShahRajesh Shah
One option is to use OnClick javascript attached to the custom button. When the button is clicked, it calls JS which then calls a Apex Class. Apex class makes the update in record type and the JS then refreshes the detail page.