You need to sign in to do that
Don't have an account?
Sanal
Unable to Upsert
Hi,
I have a custom object with just four custom fields. I'm unable to upsert while i'm able to update. What is that i'm doing wrong here? Please help!
var recObject = new Sforce.Dynabean("Process__c");
recObject.set("Name","myName");
recObject.set("control__c","myControl");
recObject.set("to_control__c", "newControl");
recObject.set("parameters__c", "someid");
recObject.set("ExternalId__c", "01");
//recObject.set("Id","a0D40000000gOxXEAU"); //used for update
var result = sforceClient.upsert("ExternalId__c",recObject)[0];
//var result = sforceClient.update(recObject)[0]; //this works fine.
if (result.success==true)
alert("Success");
else alert("failed");
---------------------------
Ajax Version used:
Thanks in advance,
Sanal
What is the error that you are seeing?
remove the [0]
so
var result = sforceClient.upsert("ExternalId__c",recObject)[0];
var result = sforceClient.upsert("ExternalId__c",recObject);
then you can look at the result and see the entire response, which should have a fault message if the call is not working.
Thank You Ron.
I was really wondering how I can get precise error messages when I'm doing something wrong.
I finally figured it out why the upsert was not working. That was a terrible mistake from my side. I gave {!API_Partner_Server_URL_60} in the sforceClient.Init() call. {!API_Partner_Server_URL_70} made everything right and perfect, since upsert was supported from version 7.0 onwards.
Regards,
- Sanal