Form Related Objects

From 3B Knowledge
Jump to navigation Jump to search

With version 4.0 of the app, you can now define related objects to be displayed where forms are rendered, throughout all instances.

{
    ...,
    "schedulables": {
        "shift": {
            ...
            "title": [
                {
                    "label": "Scheduled Start",
                    "fieldPath": "b3s__Scheduled_Start_Time__c",
                    "formatter": "dateTime",
                    "hideIfNull": false
                },
                {
                    "label": "Scheduled End",
                    "fieldPath": "b3s__Scheduled_End_Time__c",
                    "formatter": "dateTime",
                    "hideIfNull": false
                },
                {
                    "label": "Breaks",
                    "type": "break",
                    "childObjectName": "b3s__Break__c",
                    "childField": "b3s__Shift__c",
                    "parentFieldPath": "Id",
                    "title": [
                        {
                            "label": "Scheduled Start",
                            "fieldPath": "b3s__Start__c",
                            "formatter": "time",
                            "hideIfNull": true
                        },
                        {
                            "label": "Scheduled End",
                            "fieldPath": "b3s__End__c",
                            "formatter": "time",
                            "hideIfNull": true
                        },
                        {
                            "label": "Comments",
                            "fieldPath": "b3s__Comments__c",
                            "formatter": "string",
                            "hideIfNull": true
                        },
                        {
                            "label": "Last Modified Date",
                            "fieldPath": "LastModifiedDate",
                            "formatter": "dateTime",
                            "hideIfNull": true
                        },
                        {
                            "label": "Last Modified By Name",
                            "fieldPath": "LastModifiedBy.Name",
                            "formatter": "string",
                            "hideIfNull": true
                        }
                    ]
                }
            ]
            ...
        }
    }
}

You can define a child related object as a field in a record form fields by adding:

  • label - this will be the related list header label
  • type - some unique string
  • childObjectName - the api name of the object to display
  • childField - the target reference field
  • parentFieldPath - the source reference field
  • title - an array of fields to display


Note: we only support 1 level of child relationships - i.e. you cannot define a child of the child.