You need to sign in to do that
Don't have an account?
Abhishek Singh 88
i have these three object as account and client Link__c is a junction object.
now i have to find details of Client__c where i have record account.customerid__c.
query i have written is.
clientLst=[select Name from Client__c where client__c.id IN:(select Account__r.CustomerId__c from Accounts_Users_Link__r where Account__r.CustomerId__c=:currentSiteCust)];
where " Accounts_Users_Link__r "is child relation ship name
I am getting error unexpected token 'select'
Thanks in advance.
how to access one objects records using junction object when we have records of another custom object
i have these three object as account and client Link__c is a junction object.
now i have to find details of Client__c where i have record account.customerid__c.
query i have written is.
clientLst=[select Name from Client__c where client__c.id IN:(select Account__r.CustomerId__c from Accounts_Users_Link__r where Account__r.CustomerId__c=:currentSiteCust)];
where " Accounts_Users_Link__r "is child relation ship name
I am getting error unexpected token 'select'
Thanks in advance.
1. changed client__c.id to id
2. You should return the id of the object being queried from the subquery in where condition of main query. So changed Account__r.CustomerId__c to User__c(after looking your diagram with field name User)
3. changed Accounts_Users_Link__r to Accounts_Users_Link__c as it should be used with the API name in subquery in where condition.
Hope it helps.
All Answers
1. changed client__c.id to id
2. You should return the id of the object being queried from the subquery in where condition of main query. So changed Account__r.CustomerId__c to User__c(after looking your diagram with field name User)
3. changed Accounts_Users_Link__r to Accounts_Users_Link__c as it should be used with the API name in subquery in where condition.
Hope it helps.
thanks for your reply,But it is still showin same error" unexpected token :select"