You need to sign in to do that
Don't have an account?
Disable button after action
Hi,
I have this custom button that I'm using to Activate an order when clicked. Now I want this button to be hidden or grayed out when order status = Activated.
{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")}
this.disabled=true;
var c = new sforce.SObject("Order");
c.id = "{!Order.Id}";
c.Status = 'Activated';
c.Sync__c = true;
result = sforce.connection.update([c]);
window.location.reload();
Can someone help me out?
I have this custom button that I'm using to Activate an order when clicked. Now I want this button to be hidden or grayed out when order status = Activated.
{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")}
this.disabled=true;
var c = new sforce.SObject("Order");
c.id = "{!Order.Id}";
c.Status = 'Activated';
c.Sync__c = true;
result = sforce.connection.update([c]);
window.location.reload();
Can someone help me out?
You can't disable button on the basis of status value but what you can do, you can check status first and if it is Activated then simply send alert message to user i.e. Order has already been activated.
You have to override the detail page with a VF page. You just need to add a tag <apex:detail/> on that page and this will look like standard details page.
After that you can add JavaScript or jQuery to hide your button according to condition.