Skip Navigation
Expand
Self-referencing relationships reflect a record as a parent of itself
Answer ID 8018   |   Last Review Date 09/24/2018

Why do self-referencing relationships reflect a record open from a workspace as a parent of itself?

Environment:

Relationship Object, Controls used in workspaces
Oracle B2C Service, all supported versions

Issue:

When using an Incident self-referencing relationship in a report and the report is used in a workspace tab, the opened incident appears to be its own parent.

Resolution:

Self-referencing relationships can be defined for custom or standard objects that are joined by association relationships. Self-referencing relationships are configured to make an object a parent or child of itself. Workspaces for objects with self-referencing relationships can include relationship items for the object. For example, an incident workspace that includes the Incidents View relationship item can be used to associate one incident with another.

This type of configuration gives you a wide range of customization options. For example, if you have a relationship in which the incidents object is a parent of itself, you can configure incident workspaces to allow you to create sub-incidents or related incidents to help you track incidents related to the same issue. Or, if contacts is made a parent of itself, you can create contact workspaces that allow links to other contacts, such as customers living in the same residence.

However, when using an Incident self-referencing relationship in a report and the report is used in a workspace tab, the opened Incident appears to be its own parent, unless a Refresh is performed. This behavior has been confirmed to be as designed because the JOIN condition isn't supposed to reference the aliases, only the table. In this scenario, since we are joining incidents to incidents, incidents will show up on both sides on the equal condition.

You can create an Incident self-referencing relationship following the below steps:

  1. Create a new Custom Object using Object Designer
  2. Create a new Incident system attribute
  3. Under the System Attributes fields, add RequestA
  4. Make the RequestA field nullable and in single field index
  5. Go to Relationships, and set up the following relationship for Parents & Children of Incident Object:
    1. Type: Association
    2. Parent Object : OracleServiceCloud.Incident
    3. Parent Field: i_id
    4. Child Field: RequestA
  6. Save and Deploy
  7. Give visibility permission to the Custom Object to your profile
  8. Add the custom object in your Navigation set so you can create new object of this custom object type.
  9. Include the RequestA field in an incident workspace, in order to be able to select an incident reference number as the parent of a child incident
  10. Create a new report with the following columns:
    1. incidents2.ref_no
    2. incidents.ref_no
  11. In the report, click the Tables button on the ribbon
  12. A self join is necessary in this case, so select an Inner Join between incidents and incidents2
    1. Either incidents.your_custom_object$RequestA = incidents.i_id
    2. Or: incidents.i_id = incidents.your_custom_object$RequestA


Create a report using incidents.ref_no and incidents2.ref_no and add this Report in the workspace tab.

Cause:

Even if it uses the same report, the behavior is different when the incident is accessed from a workspace. For example, if you see in the report that reference number 180803-000001 is a parent of 180905-000002, when opening the Incident 180803-000001 on the tab that runs the same report, you will see that 180803-000001 is a parent of itself unless a Refresh is executed.

You can adjust this behavior by creating a workspace rule as follows:

  1. When editor loads
  2. Conditions-> Add An object is visible and select the Report Control wanted ( as shown below):
  3. Then Action -> Execute an editor command ->Refresh

You will need to know that by using this workspace rule, you might cause a performance issue (based on the amount of data that the report is processing) regarding how fast the information will be displayed in the workspace. Another consideration is that Refresh action is only correcting the self- referencing relationship from a visual perspective and child incident 180803-000001 will reflect to have 180803-000001 as parent again in the workspace as soon as an edit on itself is performed. 


For additional information, refer to the 'Working with Controls' section in the Online Help User Guide documentation. To access Oracle B2C Service manuals and documentation online, refer to the Documentation for Oracle B2C Service Products.