Learning Objectives:-
- Describe what are the different init-operations for the chained interface.
- Comfortably use different init-operation for the chained interface.
Introduction:- #
SKYVVA provides different init-operation for the chained interface i,e None, Delete First, Delete specific child, Delete Anyway, and Delete + Upsert & Delete child not present in the payload. In this tutorial, we will learn how to configure these init-operations with Interface which has a hierarchical message type.
Pre-required: #
- Upload Hierarchical Message Type.
- Create Integration and Inbound Interface.
Step 1: Upload a Hierarchical Message Type or create a Hierarchical Message Type.
- Here’s the Hierarchical Message Type
Step 2: Create an Inbound Interface and Linked Message Type.
- Here’s the Inbound Interface which is linked with Message Type.
– Do mapping #
How to configure Ichain? #
To configure the IChain Interface we need to do mapping in hirachical and then go to Interface Related see the example below.
- Go to Interface-Related
- Scroll Down to find the Ichained Interface and click IChain Interfaces Name.
- Click the Edit button.
- Now we can see How many Sections are in IChained Interface.
- Parent Interface refers to the Interface that we choose as the parent In this example we use hierarchical mapping so the first mapping is the parent Interface.
- Sequence 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 the user wants to use another Interface they can create a new IChain to config, If the user wants to use the child interface that matches the hierarchical mapping, the user just selects the Child Interface that contains _ParentInterface_ChildInterface_1.2 meaning that this is got from mapping If the mapping has more object in one Interface it will generate the Interface to suffix 1.3,1.4 so on.
- Parent Relationship Name / Foreign Field refers to the primary key between the Parent Object and to child Object depending on the primary key of each object. Example: We have many fields to look up to account depending on the ID or depend on the 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 6 operations such as None, Delete First, Delete Specific Child, Delete Child anyway, and Delete+ Upsert (we can be Called delta ). See the picture below.
Which are different init-operations for the chained interface? #
The feature with our inti operation for the chained interface is to handle the deletion of a child from the sending system. There are different init-operation for the chained interface as per the condition.
- None: Add a new child or update the existing one.
- Delete First: Delete all child records of a parent.
- Delete specific child: delete the specific child of the parent.
- Delete Anyway: This will always delete the children, no matter if you only send Parent or Parent + Children.
- Delete + Upsert: that is about deleting children does not come along with their parent
i.e. Existing accounts with contacts C1, C2, C3. if the system sends account with a contact C2, then C1, C3 will deleted from Account and insert/update C2, So Account has only 1 contact C2. - Delete child not present in the payload: this operation includes Delete + Upsert operation which means delete children that do not come along with their parent and delete all children if the user imports only parent record.
None:- #
This is the default option when we create an IChained Interface. Nothing is deleted here but the new children added or existing children updated. It is not correlated with previous data So there may be different levels between order items in SAP and Salesforce.
- Create Integration
- Create two interfaces -Account and contact where the account is the parent interface and contact is a child.
- Click on the related tab of the account interface and scroll down the page to the IChained interface.
- Click on the new IChained interface.
Delete First:- #
In this case, when the child record is inserted or updated the previous ones should be deleted. This ensures that the Salesforce page contains only the child, included in the latest payload.
We have in the an option the set “Delete First” to delete first the existing children before adding new children. 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 a child record in the message e.g. Parent + Child then it delete first all existing children and then adds the new children that 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!
How to use “Delete First”?
Follow the given steps:-
- Create a hierarchical interface Account, Contact where contact is a child interface.
- We use init Operation = Delete First.
Delete specific child:- #
How to use Delete specific child.
Follow the given steps:-
Step 1: Create a hierarchical interface Account, Contact where contact is a child interface.
We use init Operation = None
Step 2: Upload the following data.
We have account parent fields
Account (Parent fields):-
- AccountName=CacaCambo (ExternalID),
- BillingCountry=Cambodia and
Contact child fields:-
- LastName=Jen (ExternalID),
- FirstName=Jonh,
- Email = jonh@test.com
Here are the records account and contact after processed:-
Step3: Now We use init Operation = Delete Specific Child in IChained Interfaces to delete some
values in child interface data but it is not an External ID value.
Now we want to change only email value I,e jonh@test.com to jen@test.com
where,
- LastName=Jen (ExternalID),
- FirstName=Jonh like before.
So the user just pushes the above data again the data will be created again with the last change email= jen@test.com
Here is the result of contact data on message monitoring change email value:-
Delete Child Anyway:- #
Delete Child Anyway means that it will delete all children even have one or more and it will create a new child as the payload we sent.
- Here’s the Interface Delete Child Anyway
- Here are the records that have to exist in Salesforce.
- Here’s the data that exists in Salesforce
- Here’s the payload for processing that will delete these three contacts and add the new one from the payload.
- Go to monitor to see the result and click the Related To link to see the account that has been modified.
- Here’s the account in Salesforce
Delete + Upsert :- #
Deleting children does not contain in the coming payload of their parent, which means deleting all not children based on the parent’s external value, and children’s external values are not contained in the payload.
How to use Delete+Upsert.
Follow the given steps:-
Step 1: Create a hierarchical interface Account, Contact where contact is a child interface.
We use init Operation = Delete + Upsert
Step 2: Upload the following data.
We have Account (Parent Field):-
- AccountName = COCA_COLATest1(ExternalID),
- BillingCity = pp1
Contact1 (Child Field):-
- FirstName = COCA3,
- LastName = COLA_3New(ExternalID)
Contact2 (Child Field):-
- FirstName = COCA2_UpdateNew,
- LastName = COLA_2
Here are the records account and contact after processed:-
In this case, we have a Records Account that contains 2 Contacts whose external IDs are COLA_1 and COLA_2, so when we push the same Account name and 2 contacts whose external IDs are COLA_2 and COLA_3. The processing Upsert + Delete will work like to Update the COLA_2, Delete COLA_1, and add COLA_3.
Contact2 (Child Field):-
- FirstName = COCA2_UpdateNew,
- LastName = COLA_2
Here is the result of contact data on message monitoring change Contact FirstName & LastName value updated:-
Delete Child not present in the payload :- #
The SKYVVA integration application supports a combined Delete + Upsert operation, designed to manage hierarchical data efficiently. This operation ensures that child records not included with their parent are deleted. Additionally, if only the parent record is imported, all associated child records are deleted. This functionality simplifies data management, automatically removing obsolete child records, and ensuring the database remains accurate and up-to-date. The integration application enhances user control over data integrity, providing a streamlined approach to handle complex data structures within the SKYVVA environment.
Deleting children does not contain in the coming payload of their parent, which means deleting all not children based on the parent’s external value, and children’s external values are not contained in the payload.
Follow the given steps:-
Step 1: Create a hierarchical interface Account, Contact where contact is a child interface.
We use init Operation = Delete Child not present in the payload
Step 2: Upload the following data.
We have Account (Parent Field):-
- AccountName = COCA(ExternalID),
- BillingCity = Cam
Contact1 (Child Field):-
- FirstName = Long,
- LastName = Bora(ExternalID)
Contact2 (Child Field):-
- FirstName = Malina,
- LastName = Titi(ExternalID)
Here are the records account and contact after processed:-
In this case, we have a Records Account that contains 2 Contacts whose external IDs are Coca021, so when we push the same Account name and 2 contacts whose external IDs are Coca. The processing Delete Child not present in the payload will delete.
Contact2 (Child Field):-
- Name = Coca021(ExternalID)
- Name = Coca(ExternalID)
Here is the second screenshot send data to Salesforce and then the child is deleted.
Summary #
Now users understand that operations — None, Delete First, Delete specific child, Delete Anyway, and Delete + Upsert & Delete child not present in the payload within the SKYVVA integration application provide robust data management capabilities, allowing users to maintain data integrity and streamline integration workflows.