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
bkmmspbkmmsp 

S-Control Button Query

I am trying to define a button that queries the child records of the record I am sitting on.  I have started with some thing like the following which in my mind is supposed to use the id of the record I am sitting on to query the child table.

var records = sforce.connection.query("select child__c.id, child__c.field1__c from child__c where child__c.parent__c.id = {!parent__c.Id}");

I am relatively new at coding queries against ajax 8.0 so any help would be greatly appreciated.

BKM
cheenathcheenath
Query looks ok. Are you getting any errors?



Ron HessRon Hess
try

var records = sforce.connection.query("select child__c.id, child__c.field1__c from child__c where child__c.parent__c.id = '{!parent__c.Id}'  ");


note the added single quotes around the merge field