You need to sign in to do that
Don't have an account?

Creating a object in the S-Control
I am trying override the Clone button functionality so that while cloniong we can add all the related object entries. I am facing an issue when I am creating the new object in S-Control
Here is the code
var newSPQ = new sforce.SObject("SPQs__c");
newSPQ.Account_Distributor__c='{!SPQs__c.Account_Distributor__c}';
newSPQ.Additional_Terms___c='{!SPQs__c.Additional_Terms___c}';
newSPQ.Address__c='{!SPQs__c.Address__c}';
newSPQ.Close_Date__c='{!SPQs__c.Close_Date__c};'
newSPQ.Customer_Name__c='{!SPQs__c.Customer_Name__c}';
update newSPQ;
newSPQ.Account_Distributor__c='{!SPQs__c.Account_Distributor__c}';
newSPQ.Additional_Terms___c='{!SPQs__c.Additional_Terms___c}';
newSPQ.Address__c='{!SPQs__c.Address__c}';
newSPQ.Close_Date__c='{!SPQs__c.Close_Date__c};'
newSPQ.Customer_Name__c='{!SPQs__c.Customer_Name__c}';
update newSPQ;
can someone help me so that I can correct the Mistake
thanks in advance
I think the proper syntax for updating is
so you'll need to fix your last line.
You should also check to make sure that the update was successful
window.setTimeout(";", 1000);
var newSPQs = new Array();
var newSPQ= new DynaBean("SPQs__c");
newSPQ.set("Account_Distributor__c",'{!SPQs__c.Account_Distributor__c}');
newSPQ.set("Additional_Terms_Visible_to_Customers__c",'{!SPQs__c.Additional_Terms_Visible_to_Customers__c}');
newSPQ.set("Address__c",'{!SPQs__c.Address__c}');
....
var saveResult = sforceClient.Create(newSPQs);
if (saveResult[0] == null)
{
alert("Sucess");
}
else{
alert("Failure");
}
Message Edited by Whyser on 06-03-2008 02:20 PM