Hi guys,
I have an entity based record. When click on a particular record from the record list, it drills down to a different record's summary. This is happening only in production.It's all working fine in the lower environments. All the code is in sync.
The entity is a view and it's primary key is identified by rownum. I am not sure if this might be any problem.Could anyone please help me identify what might cause the issue and what could be done to rectify it?
Thanks in advance
Discussion posts and replies are publicly visible
Is the content of the Summary page also using the same entity - that is, the same View used for the Record List?
The summary interface has a lot of information, Some are from the same view, some are from different tables
So a VIEW won't have a Primary Key of its own...but you can designate one of the columns from a table that is used in the VIEW as the Primary Key...is the one you've chosen the Primary Key of the main Entity for your Record Type? (sorry, it's a little hard to discuss this in abstract - are you able to share the data model and how the VIEW is constructed from the database entities?)
Create View Test_View as SELECT ROWNUM AS ID, A.trackingId as TRACKING_ID, B.itemsId as ITEMS_ID FROM TABLE A JOIN TABLE B ON A.trackingId = B.trackingId;
I am just entering a test view which is similar to the actual view(not adding all the columns and joins).
Here A.trackingId is a primary key of table A and B.itemsId is a primary key of table B.
The view's column structure is something like this: ID is nullable, TRACKING_ID and ITEMS_ID are not nullable,
Ok, so here's the thing: ROWNUM is auto-generated by the Database on demand and there are no assurance that the order that the data is presented will align with the data held in the referenced tables from the VIEW. Looking at your VIEW I would absolutely shoot for 'TRACKING_ID' as the designated Primary Key (and also in effect the Record Id - or rp!id in Appian terms) since it appears that the parent entity is 'TRACKING' which has one or more child entities of 'ITEM'.
I am sorry if I might have misdirected the problem to rownum. I just wanted to mention that rownum is being used in the view to identify the row number. However, in the record, we are NOT using the rownum column from the view.
The record Identifier is recognised by rp!Id, the lable is identified by rf!TRACKING_ID.
When I drill down to the summary, the summary title also has rf!TRACKING_ID.
But, the issue is the tracking Id in the list and the summary page are not of the same record. Somehow, on clicking the link it's getting redirected to a different record.
What really matters here is what you're mapping the rp!id to in the CDT used to map to the VIEW. In your CDT that is used to get the data from the VIEW which attribute is designated as the Primary Key?
It's a record link, when you click on it, it will open the summary who's information is based on rf!Tracking_ID. Anyway, I don't think there is any code issue as the view is working perfectly fine in the lower environments.