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
If i understand correctly, when the data is present in table A related record and if there is a blank data in table B record its failing to write to record right?
Can we know configuration of write records(Are you saving it back). Are you saving both parent and related record in same pv! .And did you have any constraint defined in table (On update and on delete??)
Yeah I am sending data from my interface to PM and in interface I am saving data directly to related record fields and passing the same to PM. I didn't have any foreign key created in table B as without that too I can create a relationship in Appian Record. On write record I am only saving it to the same PV.
ghanashyamm0005 said: I didn't have any foreign key created in table B as without that too I can create a relationship in Appian Record.
Yeah we can create it without maintaining foreign key . But Appian gonna create a unique column constraint ( because of the one-one relationship ). Check whether a duplicate row persisted with that activityid in child table.
It's not with duplicate value issue. It's actually passing null as activityId in 2nd table and as activityId is a unique key, it's getting into error.
ghanashyamm0005 said:activityId is not populating automatically
ghanashyamm0005 said:On write record I am only saving it to the same PV.
Sorry I missed this part. Are you saying on Outputnode when you trying to save Recordupdated It's not giving you the primary key of table 1? That's weird. And it's not throwing any error?. Try saving it in different pv .