You need to sign in to do that
Don't have an account?
MattMet86
SOQl - Filter on related field
I have a visualforce page passing a value to controller.
Variable name is stFilter
My soql is:
Example
stfilter = Kansas
I only want to get back BCS__c records that have a Licenses__r record for Kansas.
Variable name is stFilter
My soql is:
Select Id, Name, User__r.Name, (Select Id,Account__c,Account__r.Name,Hub_Name__r.Name FROM Account_Counselors__r), (Select Name FROM Licenses__r) FROM BCS__c WHERE Inactive__C = FALSEHow do I filter it so that only BCS_c records that have a Licenses__r record with "Name" value matching stFilter are returned.
Example
stfilter = Kansas
I only want to get back BCS__c records that have a Licenses__r record for Kansas.
All Answers
If that doesn't work - then convert it all to a string, and do it like this...
I'll give this a try in a bit. Right now I am trying to figure out why a Related List has vanished from a page layout in my Sandbox. The related list still shows in my production environment and I haven't made any layout changes in the sandbox so not sure what happened.
Didn't understand relationship 'Licenses__r' 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.
How does it not recognize the relationship...it recognized it in the field selection a few lines earlier?
I probably lead you astray there.
BTW - it's funny how I see your post - sometimes very quickly - I'm not on the forum every day - but usually every week.