HZ_RELATIONSHIPS SUBJECT_ID and OBJECT_ID explanation

 https://community.oracle.com/thread/574250 



Scenario: Relationship between Parties; this relationship is between parties of type โ€˜PERSONโ€™ and โ€˜ORGANIZATIONโ€™ (John is Employee of Vision)

Before creating relationship, the above party records should exist in TCA. 

Where they exist? 
They exist in HZ_PARTIES table. 
What is the primary key in the HZ_PARTIES to identify these records? 
It is PARTY_ID
Is HZ_PARTIES part of FND_OBJECTS?
Yes

Two records are created in HZ_PARTIES for Vision and John with the PARTY_ID as โ€˜1234โ€™ and โ€˜5678โ€™ before you create relationship between them. 

When you create โ€œEMPLOYEEโ€ relationship between them, you have to pass the following values to the API. 


OBJECT_TABLE_NAME = โ€˜HZ_PARTIES
OBJECT_ID = PARTY_ID i.e.1234
OBJECT_TYPE = โ€˜ORGANIZATIONโ€™ i.e. PARTY TYPE

SUBJECT_TABLE_NAME = โ€˜HZ_PARTIES
SUBJECT_ID = PARTY_ID i.e.5678
SUBJECT_TYPE = โ€˜PERSONโ€™ i.e. PARTY TYPE


The purpose of these parameters is to identify the entities and the primary key between which you are creating relationship. Technically, you are creating relationship between 2 database records, which already created and are uniquely identified by a primary key in a table. 

In the above example, the API validates the values โ€˜1234โ€™ and โ€˜5678โ€™ against PARTY_ID of HZ_PARTIES and makes sure that those records exist in that table. The reason being, you cannot create relationship between Vision and John if they do not exist. 

The primary key = OBJECT_ID/SUBJECT_ID 
Table name = OBJECT_TABLE_NAME/SUBJECT_TABLE_NAME. 

Note that, the above relationship is between the 2 records existing in HZ_PARTIES table.

You can also use other entities records to create relationship if those entities are defined in FND_OBJECTS. It is normal practice that mostly relationships are created between parties ('ORGANIZATIONโ€™/โ€˜PERSONโ€™ and โ€˜PERSONโ€™/โ€™PERSONโ€™. )

To create relationship between other entities you have to do some setups. 



Comments

All Categories

Show more