Tutorial V2.41 (Lightning)

  1. Home
  2. Docs
  3. Tutorial V2.41 (Lightning)
  4. 12. What is hierarchical interface?
  5. 12.2 How to create hierarchical interface using Foreign Key?

12.2 How to create hierarchical interface using Foreign Key?

Learning Objectives

After completing this unit, you’ll be able to:

  • Describe what Custom field  is .
  • Also Can describe foreign key, Tree mapping
  • Comfortably use how to link parent interface to its child interface using foreign key and tree mapping.

Introduction

We can link two different object with each other using foreign key or tree mapping.

What Is Hierarchical Interfaces?

  • To arrange interfaces in order means hierarchical interface. It is structure in which interfaces are ranked according to levels of importance.
  • In hierarchical Interfaces, one interface is a  parent’s of other interface. It means that child interface inherited External ID from its parent’s interface. For example, Account interface is parent’s contact interface because of Contact inherited External ID from Account.
  • Also One parent interface can have many child account but child interface has only single parent interface. eg. one Account can store many Contacts, but one Contact can’t store many Accounts.

What is foreign key?

A FOREIGN KEY is a field (custom fields) in one Interface that refers to the PRIMARY KEY . The Interface containing the foreign key is called the child Interface, and the Interface containing the candidate key is called the parent Interface.

How to create Foreign key?

This is also called as object field in account object. Follow the given steps to create object field:

  • Go to Set up->Object Manager->Account-> Fields & Relationships->Click New Button.

 

  • Choose the field type: Please tick Text data type and click Next
  • Enter the details: Please Field Label: AccountId->Fill Length: 50->Field Name gets Auto->tick External ID->Click Save.
  • Establish field-level Security: Please tick visible and click next button.
  • Add to page layouts: Click only Save button.

here we get object field on Target Account Salesforce object.

we can  create Hierarchical interface in two ways:

  1. Manually creation of hierarchical interfaces:
  • We define manually two interfaces e.g. Account (parent) and Contact (child) and do mapping manually. Here we need to create the chain definition in the parent interface manually. Also in the child interface we need to create the foreign key manually.

2. Tree Mapping:

  • By using the “Tree Mapping” capability of Skyvva tool and the parent and child interface are generated automatically. Also the chained interface for the parent interface is generated and also the foreign key for the child interface is generated automatically.

1. Manually create hierarchical Interface using foreign key:

Objective:

To create parent  child relation between account interface and contact interface using foreign key.

Pre-requisite:

  • We have to create  Integration -> Go to integration tab -> fill name field -> Save it.
  • We need two  inbound  interfaces. I,e Account, contact.

Follow the given steps :

  • Account Interface Mapping:  Go to Account Interface ->Cross down to Source definition Section->Click choose file button to browse file that want to mapping->choose file->Click Open button->Click button Save.

Please drag source field to Target field->look at Data Mapping->Tick Ext ID->Click Save button.

  • Create IChain:

Go to related tab -> Scroll down page to IChainedInterface -> Click New IChained Interface

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  • Contact interface Mapping: Go to interface Contact->Cross down to Source definition Section->Click choose file button to browse file that want to mapping->choose file->Click Open button->Click button Save.

 

Please drag source field to Target field->look at Data Mapping->Tick Ext ID->Click Save button.

  • Define foreign key  on contact interface which link to account object. look up field link to account object. We are search salesforce id by external account Id which is primary key of external sys.
  • Please go to Contact Interface -> Click on Related -> Cross down on Foreign Key section->Click New Foreign Key Button.

 

  • Choose Lookup Field Name is AccountId in Combo box->Chose External Id Field is AccountId__c in Combo box->Click Save button.

 

 

 

 

 

 

 

 

 

 

 

Now you get a Foreign key.

  • Load Account data CSV using Manual Load:

Go to integration->Details->Manual Laod->Chose Inbound Interface (Active) is Account in Combo box->Choose Data Type is CSV->Click Choose File Button and Browse to choose file->Click Open Button->Click Upload Button

 

 

 

 

 

 

Cross down Total Records Found Section in Manual Load level-> Tick Records that want to load to salesforce->Click Push Button->Click Message Board to check monitory Message

 

 

 

 

 

 

 

 

Choose Interface Name to check message depend on Name and Click Search button to show message.

Finally, you can get Account has relationship with contact like screen shot below. Account Name is Test01 has five contact such as Ra1 Dr1…….

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2. Create hierarchical Interface using Tree Mapping:

What is Skyvva tree mapping?

  • Enhancement of Skyvva mapping tool to hierarchical tree view and map data of parent/child in one shut.
  • A Skyvva tree mapping  is a visual method for displaying hierarchical data related to  parent interface and child interface.
  • Skyvva tree mapping feature is built to reduce the complexity of manual work.
  • When we use tree mapping, It automatically generated all setting e.g.
    – chained interface
    – Foreign Key
    – Mapping the fidle Id to special field SKYVVA__PARENTID

Objective: Create parent child relationship using tree mapping

Pre-requisite:

  • Create  Integration -> Go to integration tab -> fill name field -> Save it.
  • Create one inbound  interface. I,e Account.(Create account interface only, child interface will be automatically created in it )

Follow The given steps:

  • Go to Account Interface.

  • Cross down to Source definition Section->Click choose file button to browse file that want to mapping->choose file->Click Open button->Click button Save.

Your uploaded CSV file structure looks like:

  • Go to mapping section -> map all account related Istructure with target account.

 

  • Scroll down the target object to contact -> map the Contact related Istructure

Mapping:

  • Select external Id for parent interface -> AccName
  • Select external Id for child Interface -> LastaName
  • Mapping with all field that include Account and Contact with sObject tree and then create foreign key account with Contact.
  • Click on the the row where account and contact link (#). It should navigate to following window:

  • Click on Ok button. Here your foreign key is created in child interface I,e contact interface.
  • Now save this. (If you doesn’t save it, you will lost your all mapping and foreign key creation on contact interface)

  • You can check that Ichained Interface  is automatically created in account interface(parent interface).
  • Go to Related tab
  • Scroll page to IChained Interface.

  • Foreign key automatically created in child interface I,e contact interface.
  • To open contact interface click on Id as shown in picture. It should navigate to:

(Note: Child interface is not display in integration).

Click on related tab -> scroll down page to foreign key section

Load Account data CSV using Manual Load:

Go to integration -> Details-> Manual Laod -> Chose Inbound Interface (Active) is Account in Combo box->Choose Data Type is CSV->Click Choose File Button and Browse to choose file->Click Open Button->Click Upload Button.

  • Choose Interface Name to check message depend on Name and Click Search button to show message.

 

Finally, you can get Account has relationship with contact like screen shot below. Account Name is TestJohn link with contact JohnKerry01.

 

 

 

 

 

 

 

Was this article helpful to you? Yes No

How can we help?