You need to sign in to do that
Don't have an account?
BAGEL
Urgent, please help.
Hi everyone,
I am using 7.0 api and 3.3 ajax toolkit. I have 2 custom objects. Everything works just fine. Until I repackage my app with the new manage package feature. I understand that I will need to modified my code to add the new prefix to each instance of custom objects and custom fields.
I can successfully get the data from one of my object. However, the other object I have problem with. Even as simple as I retrieve the Id field of the object, I still get a script error in the sforceclient.js saying
db.getItem(key) has no properties
I am using 7.0 api and 3.3 ajax toolkit. I have 2 custom objects. Everything works just fine. Until I repackage my app with the new manage package feature. I understand that I will need to modified my code to add the new prefix to each instance of custom objects and custom fields.
I can successfully get the data from one of my object. However, the other object I have problem with. Even as simple as I retrieve the Id field of the object, I still get a script error in the sforceclient.js saying
db.getItem(key) has no properties
var v = db.getItem(key).value;
Anyone has any clues?
Thanks in advance.
Anyone has any clues?
Thanks in advance.
i can't see any problem with that line :smileyhappy:
if it is providing an error but your code does not check for error, then you may see a property error as you describe, but that is a secondary error.
The real error will be passed back in a SOAP message which the toolkit will then send to your function.
can you include a bit more code? need to see what is going on between this query and the error you see.
the hConfig() function will probably have the check for success / error that is what we need to see next.
var DEBUG = true;
if(DEBUG)alert(qr.toString());
alert(qr.className + " object not available. " +
qr.toString());
return ;
}
return false;
if (qr.size > 0){
var oConfig = qr.records[0];
StageOverride = oConfig.get("WAYS__Stage_Override__c");
tmpImpList = oConfig.get("WAYS__Importances_List__c");
tmpReaList = oConfig.get("WL_Reasons_List__c");
tmpBarList = oConfig.get("WAYS__Barriers_List__c");
findAdvisorRecord(id);
}
}
var debug = false;
alert("Could not login using API");
return ;
}
userLocale = uInfo.userLocale;
dformat = Sforce.Util.GetLocaleDateFormat(uInfo.userLocale);
alert(uInfo.faultstring +
"\nThis custom link utilizes the AppExchange API.\n" +
"It appears that the Salesforce.com edition you are using does not have this feature enabled.");
return ;
}
sforceClient.Query("Select CreatedById, CreatedDate, Id, LastModifiedById, LastModifiedDate, Name, OwnerId, Stage_Override__c, Importances_List__c, WL_Reasons_List__c, Barriers_List__c, SystemModstamp from WAYS_SCMgr_Config__c", hConfig, true);
}
new AJAX toolkit is better suited to scontrol development and supported, this beta3.3 version had a minor bug in the getuserinfo(), you may be hitting that.
you could try to comment out all the getuserinfo stuff, but it's quick to port this to the latest AJAX, performance is better also.
sforceClient.Query("Select CreatedById, CreatedDate, Id, LastModifiedById, LastModifiedDate, Name, OwnerId, WAYS__Stage_Override__c, WAYS__Importances_List__c, WAYS__WL_Reasons_List__c, WAYS__Barriers_List__c, SystemModstamp from WAYS__WAYS_SCMgr_Config__c");
db.getItem(key) has no properties
toString(" ")
hConfig( className=QueryResult records=[1] size=1 done=true)
internalCallback(XMLHttpRequest readState=4)
internalCallBack(2)
f()
var v = db.getItem(key).value;
qr.toString()
but that's probably not the root of the problem, just a guess