답변 3개
You can try something like:Select Id, (Select Id From Projects__r) From Work_Request__c This way you have:
- All the WR objects (assigned to you, if the assignation is done with sharing rules or add a OwnerId filter at the end or other filter is appropriate for filtering)
- If a WR object is not assigned to anything, you will find an empty "WR.Projects__r" list(assuming Projects__r is the inverse relationship name for the "Work_Request__r" relation on Project__c)
- Otherwise you'll also have all the the Proejcts related to the WR objects.
Does it make sense?