Child relationship field missing
On the Opportunity object I have a custom field Renewed_From_Opportunity that is a lookup relationship to an Opportunity (thus linking opportunities to each other). The child relationship on Opportunity is called Renewed_In_Opportunities but it does not show up when generating the types with [email protected] (while the lookup field shows up as Renewed_From_Opportunity__r and Renewed_From_Opportunity__c).
When I manually add the following to Opportunity.ts everything works as expected:
@sField({
apiName: 'Renewed_in_Opportunities__r',
createable: false,
updateable: false,
required: false,
reference: () => {
return Opportunity
},
childRelationship: true,
salesforceType: SalesforceFieldType.REFERENCE,
salesforceLabel: 'Renewed in Opportunities',
externalId: false,
})
public renewedInOpportunities?: Opportunity[]
// ...
constructor(fields?: OpportunityFields, restInstance?: Rest) {
// ...
this.renewedInOpportunities = void 0
}
Is ts-force treating this particular relationship differently because it's linking the same object types? In any case, it would be great if it would just support this setting as well!
in theory this should work. Pretty sure I've done something similar several times. Does the parent relationship get generated?
If not, can you check FLS? If you're an Admin profile with "see all data", you can query fields you don't have read access to, but they won't show up in the tooling API