You need to sign in to do that
Don't have an account?
len123
Update Date Field Using S-Control
Hello,
I am using the Quotes appexchange and there is there Scontrol that I am trying to update that will copy details from the quote to the opportunity when copying the quote lines. From some reason it's working well with 2 text fields (Country Code and Additional Ref) but with date fields (Valid Until and presented Date) it's not working and there is an error. All the fields are customized. Here is the code, any suggestions:
Code:
function copyQuoteDetailsToOpp() { var oppid = "{!SFDC_520_Quote__c.OpportunityId__c}"; var countryCode= "{!SFDC_520_Quote__c.Country_Code__c}"; var additionalRef = "{!SFDC_520_Quote__c.Additional_Ref__c}"; var presentedDate = "{!SFDC_520_Quote__c.Presented_Date__c}"; var validUntil = "{!SFDC_520_Quote__c.Valid_Until__c}"; var oppInfo = new Sforce.Dynabean("Opportunity"); oppInfo.set("Id", oppid ); oppInfo.set("Country_Code__c", countryCode); oppInfo.set("Quote_Additional_Ref__c", additionalRef ); oppInfo.set("Quote_Presented_Date__c", presentedDate ); oppInfo.set("Quote_Valid_Until__c", validUntil ); var sa = sforceClient.Update([oppInfo])[0]; }
I've noticed that unless the dates are in YYYY-MM-DD format when updating records, Salesforce doesn't recognize them appropriately.
HTH