Posted: 20 Oct 2017 5:44 EDT Last activity: 5 Jan 2018 9:23 EST
Obj-Save make an INSERT instead of an UPDATE
I have an external class with a primary key. This class has locking enabled and test connectivity also works fine. In an activity I do Obj-Open with the primary key and then update one of the property(non-key) followed by Obj-Save(with Write-Now). The Obj-Save fails with error - "Cannot insert explicit value for identity column in table 'TABLE_NAME' when IDENTITY_INSERT is set to OFF." even though I am not updating key column. If I do not use Write now option in Obj-Save then the Obj-Save does not fail but then the subsequent Commit fails with same error. I suspect Obj-Save is somehow trying Insert instead of Update.
We are using Pega 7.3.0 and the table is in external MS SQL Server database. Any help would be great. Kindly let me know in case more details are needed.
Thank you for the answer. I have checked that and only an update is being attempted and not insert. But apparently Pega does not support update on tables which have identity column as mentioned in below support article. So now I am using Connect-SQL. Kindly let me know if a better way exists.