Related Object
Related Object
For example, if you are adding a Committee Participant to a Committee, and you are adding it from within the Committee (as a Child Form), then when you add the participant you would like for the Committee to be defaulted to that of the committee from which you are adding the participant.
A Related Object eliminates the need for a user to select the parent record when they are already on that record (typically from a Profile Form). Related Object Controls describe the actual control from the related object (aka the "parent" object) whose value will get put into that of the relating object (aka the "child" object). A related object must have at least one related object control but can have more.
Think of a related object and related object control as a tool that sets the value of a foreign key column of a child table to a certain primary key of the parent table.
Controls
Related Object
- Relating Object: The object whose controls you want to be initialized to that of the Related Object.
- Related Object: The object whose values will populate those of the Relating Object.
- Form: The form on which you want the object relationship to be invoked. If left blank, then the relationship will be invoked on all forms of the Relating Object. Generally, leave this field empty unless you have a object relationship that should happen on only one form.
- Description: The description of the Related Object. By convention, name this Relating Object -> Related Object, for example: Committee Participation -> Committee.
- Order: The order in which related object relationships should be fired.
- Exclude If Have Relating Object: Check this checkbox to disable the object relationship when the object relationship is not immediate.
If you check Exclude If Have Relating Object checkbox, then the related object relationship will be excluded when retrieving related object controls *IF* the framework knows the Object Key for the source form (e.g. where you are navigating *FROM*).
For example, for the Invoice object, there are related objects (and controls) for Individual and Organization. When I’m going to the Order Entry form from Individual profile, I do not care about the Organization related object controls and vice versa.
This feature is useful when you want to use the same dynamic form for multiple purposes (e.g I do not want to create separate version of the order entry form for Individual and Organization).
The way this works is the framework now adds the “ObjectKeyFrom” parameter to the query string if it is known. (item links, content links, child form links).
The default value for “Exclude If Have Relating Object” is 1 which means pull the related controls (e.g. maintain compatibility with forms/related objects that have already been created). Generally, this checkbox should always be checked.
Related Object Control
A Related Object Control specifies the actual controls who will set a value and get a value.
- Object Relation: The parent related object.
- Control To: The control of the related object you want initialized.
- Control From: The control from the relating object whose value will be used to populate the control to. In the example above, the Primary Key of the Committee object (cmt_key) will have its value passed into the Foreign Key (cmc_cmt_key) of the Committee Participant object.