Output Child Records related to the Lookup Field

Output child records related to the record of the lookup field.

*This feature is available in Office File Creator Pro.

*This feature is for developers and advanced users who require knowledge of SOQL. SOQL is not covered by inquiry support.

*This feature will be released soon.

 

Overview

Examples of Use

  • Output the Case child records related to the Account lookup field of the Opportunity.

 

Required settings

  • Merge Fields Settings
  • OFC_Child Object Option Record Settings

 

 

Determine Child Relationship Name

Determine the child relationship name used to link the merge fields to the OFC_Child Object Option record.

 

Naming Rules for Child Relation Name

Only alphanumeric characters and underscores are allowed, beginning with the Roman alphabet.

 

Examples of child relationship names

AccountCases

Cases

 

 

Merge Fields Settings

Set the merge field in the template file in the form of {!ChildRelationName.FieldAPI Name}.

e.g. {!AccountCases.CaseNumber}

 

 

OFC_Child Object Option Record Settings

Open the OFC_Child Object Option record detail page.

Reference: Create OFC_Child Object Option Record

 

Name: Enter any name. e.g. Account Cases

Child Relationship Name: Enter the child relationship name. e.g. AccountCases

 

Enter the field values in the "(Pro) Advanced Relationship Settings" section.

Object API Name: Enter the object API name of the child object. *Not a child relationship name.

(Advanced) SOQL (Where): Enter a SOQL subquery. The subquery should specify the condition after Where and must include "=:recordId." The "recordId must match up to lowercase.

*It is not allowed to enter both "Master Object Id Field API Name" and "(Advanced) SOQL (Where)".

 

How to check the cross-object formula

Check with the following SOQL in the developer console or Dataloader. When checking, "Id =: recordId" should be changed to "Id='Master object record Id'".

Select Id From Object API Name Where (Advanced) SOQL (Where)

 

 

Setting Example

Example1: Output child records of the master object's look-up field

The master object is Opportunity, the lookup field is Account, the child object of Account is Case, and output Case.

Object API Name: Case

(Advanced) SOQL (Where): AccountId In (Select AccountId From Opportunity Where Id =: recordId)

 

Example2: Output child records of the child object's look-up field

The master object is Opportunity, the child object is OpportunityContactRole, the lookup field of OpportunityContactRole is Contact, the child object of Contact is Case, and output Case.

Object API Name: Case

(Advanced) SOQL (Where): ContactId In (Select ContactId From OpportunityContactRole Where OpportunityId =: recordId)

 

 

Note

  • The SOQL setting is for developers and advanced users who require knowledge of SOQL and is not covered by inquiry support.