You need to sign in to do that
Don't have an account?
Javascript problem
Hi all does anyone have any idea why when i put "c.Support_Term__c+=1;" into this script it stops working? the editor tells me that the syntax is correct? and when i take this line out the PO_Status__c gets updated as expected. All Suport_Term__c is is a number(3,0) with a default value of 0.
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
var newRecords = [];
var c = new sforce.SObject("Purchase_Form__c");
c.id ="{!Purchase_Form__c.Id}";
c.Support_Term__c+=1;
c.PO_Status__c = "Submitted";
newRecords.push(c);
Thanks
result = sforce.connection.update(newRecords);
window.location.reload();
Try like this
c.Support_Term__c = {!Purchase_Form__c.Support_Term__c} + 1;
Regards,
Magulan D
Salesforce.com certified Force.com Developer.
SFDC Blog
SFDC Site
If this post is your solution, kindly mark this as the solution.
All Answers
Try like this
c.Support_Term__c = {!Purchase_Form__c.Support_Term__c} + 1;
Regards,
Magulan D
Salesforce.com certified Force.com Developer.
SFDC Blog
SFDC Site
If this post is your solution, kindly mark this as the solution.
Ah! thats got it! thanks for your help!