You need to sign in to do that
Don't have an account?
Rony57
JavaScript on custom button
Hello Guys,
I am having a trouble while running a JS on my button . I have a button name Make Available on my detail page and there is a pick list name status which is by-default Pending. Whenever user click on Make Available button then the status would automatically change from pending to Available. Following is my code :-
I am having a trouble while running a JS on my button . I have a button name Make Available on my detail page and there is a pick list name status which is by-default Pending. Whenever user click on Make Available button then the status would automatically change from pending to Available. Following is my code :-
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} var pro = new sforce.SObject('SPBE__Property__c'); pro.Id = '{!SPBE__Property__c.Id}'; pro.SPBE__Status__c= 'Available'; var result = sforce.connection.update([pro]); if(result[0].success=='true'){ alert('The Status Updated Successfully'); } else{ alert('The Status Updated Unsuccessfully'); } window.location.reload(true); }
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}
var acc = new sforce.SObject("Account");
var F_Flag = '{!Account.F_Submit__c}';
acc.id='{!Account.Id}';
if(F_Flag == true) acc.F_Submit__c="false";
else acc.F_Submit__c="true";
result=sforce.connection.update([acc]);
window.location.href = window.location.href;