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
JuanTalJuanTal 

get Id from a query

if i have this

var resultpre = sforce.connection.query("SELECT id FROM presupuesto__c WHERE name ='"+cuenta+"'");

i wanna get the acces for id 

how can i do this ?

i try:

resultpre.id

resultpre[0].id

 

but nothing

 

help...

Best Answer chosen by Admin (Salesforce Developers) 
b-Forceb-Force

you need to parse query result in following way

 

 

var records = resultpre.getArray('records');
var id = records[0].id;

 

 

Cheers,

Bala