Skip to content

Child relationship field missing #116

@andrenarchy

Description

@andrenarchy

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 ts-force-gen@3.0.2 (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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions