Posted: 4 Jun 2020 12:40 EDT Last activity: 4 Jun 2020 15:55 EDT
Savable DataPage issue with 'pxCreateOpName' property
I have a class, let's say -> 'A-Data-B'. It has 3 keys, one of them being 'pxCreateOpName'.
This class is mapped with a database table and using a savable data page, records are getting added and modified from the UI in this table.
Lets assume a very first record is added and its pzInsKey is:
"A-DATA-B C-1!20200604T172942.000 GMT!User1"
1. 'C-1' is key 1, which is nothing but case ID.
2. '20200604T172942.000 GMT' is key 2, which is current date time.
3. 'User1' is key 3, which is defined to 'pxCreateOpName'. This is getting set to user's last name in the code, but Pega is changing to user's full name after insertion. (See below note in bold that who does this and when this happens)
Now another user, User2 edits this item, lets say changes the 'Comment'. On submit, savable datapage identifies it as an existing record, but while saving, changes the 'pxCreateOpName' value to User2's full name and hence while commit, a new record is getting added in the table as a new pzInsKey is formed.
I traced and found this OOTB activity 'Save' in @baseclass changes the pzInsKey in step 13.
Can anyone tell me why this activity is changing 'pxCreateOpName' value.
Usually, We cannot edit a key-value once the row is created in the database table. If you want to change that, you have to delete that row and should add it. I think, As you are trying to update pxCreateOpName which is a row key, It cannot be altered after once row is created. So it is creating a new record with new pzInsKey.
No where I mentioned that we want to update or updating the key intentionally/unintentionally. I clearly mentioend savable datapage is doing that and I did mentione the activity and step number too which is doing it. :)