iChained Interface #
We use iChained Interface to create a chain between the parent interface with the child interface.
How to create iChained Interface?
- To create an IChained Interface user need to have Interface that has hirachical mapping. user can use the properites in Ichained Interface. To configuration IChained Interface, User need to go to Interface and Related page and scroll down to find IChained Interface section.
- Click the Interfaces name
- Click Edit button.
- Now we can see How many Section in IChained Interface.
- Parent Interface refers to the Interface that we choose as the parent In this example we use using hierarchical mapping so the first mapping is the parent Interface.
- Sequence is refers to creating an order, an order sequence number is generated and can be used to identify the order.
- Child Interfaces refers to the Interfaces that we selected the other interface as the child. In this case if user want to use other Interface they can create the new IChain to config , If the user want to use the child interface as the match as the hierarchical mapping, user just select the Child Interface that contain _ParentInterface_ChildInterface_1.2 meaning that this is get from mapping, If the mapping have more object in one Interface it will generated the Interface to suffix 1.3,1.4 so on.
- Parent Relationship Name / Foreign Field is refers to the primary key between Parent Object to child Object depends on the primary key of each Objects. Example: We have many fields to look up to account depend on ID or depend on name so we can select the fields that we want to look up meaning that if the records that parents is exits as the same parent payload it will update the parent records and insert the child payload.
- Init Operation is the useful functions that allow users to modify the child Interface when we do inbound. In this function there are 5 operation such as None, Delete First, Delete Specific Child, Delete Child anyway, and Delete+ Upsert (we can Called delta ). See the picture below.
There are 5 Init Operations and it is working in difference ways.
- When user using “None” meaning that it is working normal when we do inbound processing ,example if the parent records is not exits it will insert the parent payload and child payload , if the parent records is exits and the child has exits it will update the child records, if the parent records is exit and the child has not exits it will insert the child records.
- When user using “Delete First” meaning that when the parent records is exits in salesforce and have many child records, it will delete the only the first child and keep another child and Insert the new child of payload. For example, the message comes with message A. If A contains a child record then the deletion works. In this case, we delete all existing children and create the new child coming with the new message. But if we send only the parent data only parent data get updated. No children get deleted. “Delete First” in Chain is that when we have child record in the message e.g. Parent + Child then it delete first all existing children and then adds the new children which come with the current message. The sender needs always to send all children. The sender cannot send only children which have been changed at the sender system. If he only sends a changed record which has been changed at the sender system the situation on both systems. e.g. sender and Salesforce are not consistent anymore. This mode does not support that the sender sent deltas. This mode works only correctly when the sender always sends in full mode e.g. all children every time!
- When user using “Delete Specific Child “ meaning that when the parent record is exits in salesforce and the child Interface is exist and we want to change the some field in child record so it will delete the child records that has specific child external id and add the new child with the same.
- When user using “Delete +Upsert ” meaning that when Parent interface for object Quote * Child interface for object QuoteLineItem * Existing records in system: * Quote XYZ * Quote Line Item 1 * Quote Line Item 2 * Incoming: * Quote XYZ * Quote Line Item 2 * Quote Line Item 3 * Expected result: * Quote XYZ updated * Quote Line Item 1 deleted * Quote Line Item 2 updated (IMPORTANT: THIS DOES NOT MEAN “DELETE”+”INSERT”) * Quote Line Item 3 inserted.