You need to sign in to do that
Don't have an account?
dasari123
Undefined is not a function in javascript
Hi,
I am getting undefined is not a function as error when i click a button .
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")}
var acct = new sforce.SObject("Account");
acct.name = 'New Account';
acct.phone = '515-123-4567';
var result = sforce.connection.create([acct]);
if(result[0].getboolean("success"))
{
alert('Record created Successfully' +result);
}
else
{
alert('could not create record' +result);
}
Can someone help me where iam lacking exactly
I am getting undefined is not a function as error when i click a button .
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")}
var acct = new sforce.SObject("Account");
acct.name = 'New Account';
acct.phone = '515-123-4567';
var result = sforce.connection.create([acct]);
if(result[0].getboolean("success"))
{
alert('Record created Successfully' +result);
}
else
{
alert('could not create record' +result);
}
Can someone help me where iam lacking exactly
Try
result[0].success == 'true'
instead of
(result[0].getboolean("success")
Javascript methods are case sensitive. In your code getboolean is defined wrong it has to be getBoolean()
Thank you.
Kartik