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

Custombutton javascript error.please help
Hi ,
I am trying to do Java script,on click of a custom button.
I am trying to fetch a custom field from another record and check against it
{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")} //adds the proper code for inclusion of AJAX toolkit
var acc_ID = "{!Lead.Account__c}";
var accounts = sforce.connection.query(
"Select Eligible_for_Deal_registration__c From Account WHERE ID = '" + acc_ID + "'");
var records_accounts = accounts.getArray("records");
var account_eligbility = records_accounts[0].Eligible_for_Deal_registration__c;
But giving me this error below.
Cannot read property Eligible_for_Deal_registration__c of undefined
put alert(accounts); immedietaly after sforce.connection.query statement;
what does it alert?