Creating a child object (Record 'Alt in' Relationship)
The code
To add a new object to one of the child object collections on a TrimMainObject, for example adding a RecordRelationship to a Record, requires sending an array containing one or more objects to the appropriate collection. For Example, posting the code below to the Record endpoint will cause Record 9000000002 to be 'Alternately contained within' Record 9000008050.
{ "Uri":9000000002, "ChildRelationships":[ { "RecordRelationshipRelatedRecord":9000008050, "RecordRelationshipRelationType": "IsAltIn" }] }
An example with triggers
This sample creates a new Schedule and also a trigger for that schedule, to add the trigger to an existing Schedule use the Uri property instead of Name and Title. Determine which properties are available for the ChildTriggers array using the page 'help/ChildCollections' in the ServiceAPI help.
Post the following to the '/Schedule' endpoint.
{ "ScheduleTitle": "My Test", "ScheduleName":"8", "ChildTriggers": [{ "ScheduleTriggerTriggerType":"Destroyed", "ScheduleTriggerDelayType":"Days", "ScheduleTriggerAfterDays":20, "ScheduleTriggerDateType":"ContentDateFinalized" }] }