+ Start a Discussion
wpatterswpatters 

ParentId Query in S-Control

Ok, so this has been immensely irritating.  I am trying to do a soql query in an s-control to get all the children of the parent element.  My query is set up just fine, and it gives good results in Eclipse, but when I run it in firefox or explorer in the s-control, it keeps saying that there's no ParentId column in the campaign table... here's the query

Code:
var c1result = sforce.connection.query("SELECT NumberSent, Market_Code__c, Actual_Cost_of_Tactic__c, Total_Gross_Revenue__c  FROM Campaign WHERE Campaign.ParentId = '{!Campaign.Id}'");

 I have also tried Parent, ParentID, Parent.ParentID, and Parent.Id in place of the Campaign.ParentId field.  Any help would be greatly appreciated! Thanks





Message Edited by wpatters on 09-15-2008 05:07 PM
SteveBowerSteveBower
As near as I can see, there is no ParentId field in a Campaign object.  

Might you mean ParentCampaign?    I think the hierarchical Campaigns feature is relatively new.  Are you using the right API versions of everything?

For example, I don't have that field in my schema when I look through Eclipse.  Possibly because it has to be set up or enabled for an organization?

Best, Steve.
wpatterswpatters
I figured it out, I had to make a hidden formula field and reference that from the s-control... strangely it recognized parent id in the formula field, but not in an s-control.