Advanced Relationship Settings

Advanced relationship settings allow for three levels of child record output, or the same child record in different layouts.

*This feature is available in Office File Creator Pro.

Overview

Examples of Use

  • Output child records of 3 or more levels.
  • Output a child record detail line of the Opportunity and the total line of the child record.
  • Output different layouts for open and closed statuses for cases related to the Account record.
  • Output the Case child records related to the Account record of the Opportunity look-up fields.

 

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

Products1

OpportunityLineItems (When outputting the three-level hierarchy of Account - Opportunity - OpportunityLineItem, the child relationship name "OpportunityLineItems" of the OpportunityLineItem is also available.)

 

Merge Fields Settings

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

e.g. {!Products1.ProductName}

 

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. Products

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

 

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

Normally, child records are retrieved from the child relationship name, but when advanced relationships are set up, child records are retrieved from the entered "Object API Name" and "Master Object Id Field API Name ".

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

Master Object Id Field API Name: Enter the cross-object formula that references the master object Id.

(Reference: Use cross-object formulas to display parent/reference object fields in merge fields)

 

How to check the cross-object formula

Check with the following SOQL in the developer console or Dataloader.

Select Id From Object API Name Where Master Object Id Field API Name = Master object record Id

 

Example

The master object is Account and the third-level OpportunityLineItem (Account > Opportunity > OpportunityLineItems)

Object API Name: OpportunityLineItem

Master Object Id Field API Name: Opportunity.AccountId

 

(Advanced) SOQL (Where) Settings *For developers and advanced users

The WHERE clause of SOQL can be specified to retrieve child records and used to specify a subquery.

*This function is for developers and advanced users who require knowledge of SOQL.

 

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.

 

How to check the SOQL

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)

 

Related Manual

Output 3 or More Levels of Child Records

Output Child Records related to the Lookup Field

Output Child Records in Separate Tables for Each Filter Criteria

Output Related Files in Separate Tables for Each Filter Criteria

 

Note

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

 

Reference

Output records of grandchild objects (3 levels) to documents

Output the total amount of child records using the aggregate function in the merge field

Output different layouts for open and closed cases - Advanced Relationship Settings