Reply
Regular Contributor
raki
Posts: 29
0

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

 

Moderator
bob_buzzard
Posts: 6,467
0

Re: soql query issue error

Change 'owner.id' to 'ownerid' - that is a field present on the record.

--
Certified Salesforce Technical Architect, Developer, Advanced Developer, Administrator, Advanced Administrator, Consultant, Sales Cloud Consultant,Service Cloud Consultant
Force.com MVP | The Bob Buzzard Blog | Linked In | Twitter

I don't respond to private messages/emails asking for help.


Take the Bob Buzzard Sobject Fields quiz.

Regular Contributor
raki
Posts: 29
0

Re: soql query issue error

[ Edited ]

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

Moderator
bob_buzzard
Posts: 6,467
0

Re: soql query issue error

Is this a detail record in a master detail relationship?

--
Certified Salesforce Technical Architect, Developer, Advanced Developer, Administrator, Advanced Administrator, Consultant, Sales Cloud Consultant,Service Cloud Consultant
Force.com MVP | The Bob Buzzard Blog | Linked In | Twitter

I don't respond to private messages/emails asking for help.


Take the Bob Buzzard Sobject Fields quiz.

Regular Contributor
raki
Posts: 29
0

Re: soql query issue error

yes,there is one look up field in this object with master detail relationship

Moderator
bob_buzzard
Posts: 6,467
0

Re: soql query issue error

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.

--
Certified Salesforce Technical Architect, Developer, Advanced Developer, Administrator, Advanced Administrator, Consultant, Sales Cloud Consultant,Service Cloud Consultant
Force.com MVP | The Bob Buzzard Blog | Linked In | Twitter

I don't respond to private messages/emails asking for help.


Take the Bob Buzzard Sobject Fields quiz.

Regular Contributor
raki
Posts: 29
0

Re: soql query issue error

how to do that to follow the relationship to master

Moderator
bob_buzzard
Posts: 6,467
0

Re: soql query issue error

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:

 

Parent__r.OwnerId

 

--
Certified Salesforce Technical Architect, Developer, Advanced Developer, Administrator, Advanced Administrator, Consultant, Sales Cloud Consultant,Service Cloud Consultant
Force.com MVP | The Bob Buzzard Blog | Linked In | Twitter

I don't respond to private messages/emails asking for help.


Take the Bob Buzzard Sobject Fields quiz.

Regular Contributor
raki
Posts: 29
0

Re: soql query issue error

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

Regular Contributor
raki
Posts: 29
0

Re: soql query issue error

[ Edited ]

public list<Support__c> objs = [select id,name,checkbox__c,question__c from Support__c where checkbox__c =: true or ownerId = '00520000001wFyE' ];