You need to sign in to do that
Don't have an account?
How to check a custom checkbox field when certain conditions are met?
I'm trying to write a one line OnClick Javascript code for unchecking a custom checkbox field when certain conditions are met. Can anyone please help me write it?
Name of checkbox custom field: "Active"
Here's the pseuodocode:
Set "Active"(checkbox)= False
where Account= X
and Installation = QA
In the same class you may update the object A by setting that boolean flag.
and then refresh the page using
window.parent.location.replace(newURL);
where newURl points to the Object A record we are updating
Try This(below is example for lead object) :
{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
var newRecords = [];
var c = new sforce.SObject("Lead");
c.id ="{!Lead.Id}";
alert(c.id);
c.CheckByButton__c= true;
newRecords.push(c);
result = sforce.connection.update(newRecords);
window.location.reload();
======
replace c.CheckByButton__c with the field name that exist on the object