function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
J_HinderJ_Hinder 

AJAX DynaBean underscore problem

So,

When I do this:

var cm = new DynaBean("CampaignMember");
cm.set("CampaignId", "foo");

everything's just peachy, but when I add in an underscore:

var cm = new DynaBean("CampaignMember");
cm.set("Campaign_Parent_Id__c", "foo");

I get this javascript error:

Line:111
Char:3
Error: Exception Thrown and not Caught
Code:0
URL: https://na1.salesforce.com/servlet/servlet.Integration?lid=01N300000000BwA&eid=a0130000001LClI&enc=UTF-8

Weird, eh?
J_HinderJ_Hinder
Interesting Addition to the problem,

I thought, 'Hmm....maybe its the fact that I'm using Beta1 and not Beta2', so I changed it to beta2. Still have the same problem, however it's now on line 113 instead of 111.

This leads me to believe that it's not something on my end. Is it?
DevAngelDevAngel
Hi J_Hinder,

Wrap the call in a try catch block:

try {
cm.set("Campaign_Parent_Id__c", "foo");
} catch (e) {
alert(e + " - " + e.message);
}

See what the alert puts up.

By the way, I tried this with a custom field on an account object and had no errors.
J_HinderJ_Hinder
Yeah, I saw other folks doing it without problems, too, and figured it was odd that only I was seeing the problem. Anyhow, I changed it to use a queryresult for now, but I'll troubleshoot it some more later.