Write Record smart service failed while writing record to related record

Certified Lead Developer

Hi Champ,

I have Record which is having one to one relationship with one more record type. I have enabled the checkbox which says write or delete related record. It is behaving in a very awkward way.  So, my Use case is having a milestone. Where I can save my data as a draft. If I save the data as draft by filling both record data, it is writing data in both table without any issue by using the foreign key. But when I saved as draft without filling related record data and 2nd time in filling in , it's giving error as unique constraint violation.

So to give more explanation.

I have a table A having activityId as primary key and auto incremented.

I have a table B having  activityId as Unique key and a foreign key to table A activityId.

Scenario 1

If I fill both table A and table B data initially and saving it..It is working fine and writing data to both table.

Scenario 2

I am filling info which is part of only in table A . then data is writing fine in Table A. Now when I fill the data which is part of table B, It's throwing that error. When I see the Process Variable, I can see the related record one , activityId is not populating automatically. So it's throwing that error. I am using latest version of Appian 24.1

  Discussion posts and replies are publicly visible