Why do self-referencing relationships reflect a record open from a workspace as a parent of itself?
Relationship Object, Controls used in workspaces
Oracle B2C Service, November 2014 and newer releases
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.
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 suppose 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:
- Create a new Custom Object using Object Designer
- Create a new Incident system attribute
- Under the System Attributes fields, add RequestA
- Make the RequestA field nullable and in single field index
- Go to Relationships, and set up the following relationship for Parents & Children of Incident Object:
- Type: Association
- Parent Object : OracleServiceCloud.Incident
- Parent Field: i_id
- Child Field: RequestA
- Save and Deploy
- Give visibility permission to the Custom Object to your profile
- Add the custom object in your Navigation set so you can create new object of this custom object type.
- 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
- Create a new report with the following columns:
- In the report, click the Tables button on the ribbon
- A self join is necessary in this case, so select an Inner Join between incidents and incidents2
- Either incidents.your_custom_object$RequestA = incidents.i_id
- 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.
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:
- When editor loads
- Conditions-> Add An object is visible and select the Report Control wanted ( as shown below):
- 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 online documentation for the version your site is currently running. To access Oracle B2C Service manuals and documentation online, refer to the Documentation for Oracle B2C Service Products.