I have a lookup field in my opportunity object. It is not available in page layout for some user, but they should able to clear this value of this field.

I have created a custom button with javascript, but it not working as expected. Kindly help me. CDH_Account__c - lookup field.


var opptyObj = new sforce.SObject("Opportunity");

opptyObj.Id = '{!Opportunity.Id}';
opptyObj.CDH_Account__c = "";

var result = sforce.connection.update([opptyObj]);

if (result[0].success=='false') {
} else {

1 Answer 1


You can solve this declaratively by using a process builder and a checkbox field. Set the process so that when a user checks the checkbox field the process builder will fire. The Process builder runs in system mode so it can take action on records that the user typically is unable to and can update the field on their behalf.

If you need to use a button, you can use a visual flow along with the above to kick off the process.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .