0

I am running this query.

select id, name, Community_Partner__c, Community_Partner__r.Name from Engagements__c where id = 'a005e000003wKuwAAE'

and the results returned show that the lookup field community partner is empty. Yet when I go to the record page there are 4 community partners.

Am I missing something? If I do the same thing in the sandbox the results are showing but not in production.

Data model : Engagement has a lookup field called community partners. The schema is attached.

Image of the record page Image

Results of the query. Results

Thanks!

After suggestion..

enter image description here

schema

Result of new query.. enter image description here

1 Answer 1

2

You are checking incorrect information with SOQL. I don't know your data model, but Engagements__c.Community_Partner__c seems like a main partner or something like this.

To get info you need either select id, name FROM Community_Partner__c where Engagements__c = 'a005e000003wKuwAAE', or select id, name, (SELECT Id, Name FROM Community_Partners__r) from Engagements__c where id = 'a005e000003wKuwAAE'.

You need to select all Community Partners that are related to Engagement, not a single Community Partner that is specified on the record.

UPDATE

after seeing the schema I would suggest following query to discover what you have on the org.

SELECT Id, Name, Engagement__c, Engagement__r.Name
FROM Community_Partner__c
LIMIT 200
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.