$Ref Field - Database already contains a document with this ID (UNID)

I have a FormA that uses FormB by using @dialogbox. When I save FormB, it comes back to FormA with the values from FormB which is good - thats what needs to be done. However when I save FormA it gives me the notes error of “Database already contains a document with this ID (UNID)”

I understand that I am using a parent/response process, and I had searched the forum and other sites on how I can make FORMA a standalone form or vice versa, I’ve came across something to delete the $Ref field such as FIELD ~$Ref := @DeleteField;

I tried to use this formula in my save button on FORM B before the @command(FileSave) and it doesnt seem to be working.

Do I physically need to create this $Ref field on FORMB?

Any assistance is greatly appreciated.

thanks!

Subject: Are you sure there isn;'t something in the save events for the form that are trying to write the $REF field manually?

Subject: RE: Are you sure there isn;'t something in the save events for the form that are trying to write the $REF field manually?

Yes Im sure there is nothing writing to the $Ref field manually

Subject: $Ref Field - Database already contains a document with this ID (UNID)

I just used a different approach. Instead of using @dialogbox I used @compose