You need to sign in to do that
Don't have an account?
soql query issue error
Hi, I am new to salesforce.
I creates a VF page to retrieve the data from custom object this page is design for customer portal user. There is a check box in object the condition is if check box is checked then record need to display if not record should not exist and also if potal user create the record in that case records should display by default even thought whether the check box is ticked are not
my soql query
public list<Support__c> objs = [select id,name,checkbox__c,question__c from Support__c where checkbox__c =: true or owner.Id = '00520000001wFyE' ];
for this IM getting error as
IssueUpdateClass Compile Error: Didn't understand relationship 'owner' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names. at line 7 column 42
Change 'owner.id' to 'ownerid' - that is a field present on the record.
i changed fro owner.id to ownerId
this is the error im getting now
No such column 'ownerId' on entity 'Customobject__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names
Is this a detail record in a master detail relationship?
yes,there is one look up field in this object with master detail relationship
In that case the detail won't have an owner - you'll need to follow the relationship to the master and check the owner id of that.
how to do that to follow the relationship to master
The relationship will be the name of the custom field that has the relationship, but with '__r' rather than '__c'.
E.g. if the relationship field is 'Parent__c', then you'd have:
Yeah, but IM looking for user id
E.g.: I created a visualforce page in which object had a check box so if this check box =: 'true' than the records should display (working properly)
I need to put this page in customer portal, Here will be only one user to login to this portal to my knowledge. Here comes the trouble
if customer portal user insert the record then the record should display in visualforce page even though if the check box is checked or not
public list<Support__c> objs = [select id,name,checkbox__c,question__c from Support__c where checkbox__c =: true or ownerId = '00520000001wFyE' ];
I understand that. However, the fact is that detail records don't have owners. The owner is derived from the parent record.
You could use the CreatedById on the record - that would have the id of the user that created the record.
thanks bob
How to make the check box true even if it is not ticked in visual force page, I mean the picture with tick mark.
<apex:column headerValue="checkBox" value="{!Records.checkBox__c}" style="{!IF(Records.checkBox == true,'','')}"/>
but its not working, is ther any other way
You'd need checkbox__c to be set to true to get this. Otherwise you need to decouple the value from your record, maybe via a wrapper class.