You need to sign in to do that
Don't have an account?
DannyTK
Create a button to update fields on Custom Object
Good afternoon,
I'm looking to create a button on a custom object that updates the owner and status of the record on the object (Sales_Order__c). So on button click, the owner changes to a specific queue, and the status updates to "Sales Order Submitted". What i have below so far:
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
var sor = new sforce.SObject("Sales_Order__c");
sor.Id = '{!Sales_Order__c.Id}';
sor.OwnerId = '00Ge0000000XKF0';
sor.Status__c = "Sales Order Submitted";
var result = sforce.connection.update([sor]);
window.location.reload();
but when i click the button, nothing happens. Can someone take a look and let me know where i went wrong (no error message, screen just refreshes but changes aren't made).
I'm looking to create a button on a custom object that updates the owner and status of the record on the object (Sales_Order__c). So on button click, the owner changes to a specific queue, and the status updates to "Sales Order Submitted". What i have below so far:
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
var sor = new sforce.SObject("Sales_Order__c");
sor.Id = '{!Sales_Order__c.Id}';
sor.OwnerId = '00Ge0000000XKF0';
sor.Status__c = "Sales Order Submitted";
var result = sforce.connection.update([sor]);
window.location.reload();
but when i click the button, nothing happens. Can someone take a look and let me know where i went wrong (no error message, screen just refreshes but changes aren't made).
sor.Status__c = "Sales Order Submitted";
to
sor.Status__c = 'Sales Order Submitted';