Parent record deleting when child repeat record is deleted

09-15-2021 12:18 PM
New Contributor II


I am running into an issue with a survey I built off of an existing feature service. The parent feature class it was built off contains every parcel at which a survey could be submitted - so the user searches through their inbox to bring in existing attributes and add their record as a repeat in a connected child table. As I am troubleshooting prior to launch, I noticed that if I delete a selected repeat record with the trash can icon (highlighted below) in the "Data" tab of the Survey123 manager web site, the parent parcel it is connected to is also deleted. Afterwards the child record still shows in the table but gives the error message "The corresponding survey cannot be found in the main layer." and the associated parcel feature is deleted completely from the parent table. 


I am confused as to how these could be deleted. The behaviour is the same no matter if I set the relationship as composite or simple. I thought maybe I could revoke all deleting abilities but I am seeing the delete button in the manager site even when I removed rights to delete features while publishing the feature service to AGOL, and made sure deleting privileges are also unchecked in the feature service settings in AGOL. I could just not give users access to the manager website at all, as that seems to be the only area where deleting is possible, but I want them to be able to export their data as a table and analyze, etc. 

I definitely do not want any of the parent parcels to be deleted by users, and it would be nice if the child repeat records could be deleted without affecting the parent record (especially during troubleshooting, or in the future if a user makes an accidental record). Any ideas on if this is possible or if I am missing something obvious? 

Thanks in advance.

0 Kudos
1 Reply
MVP Esteemed Contributor

Sounds like you relationship class is backwards.  It will delete children if the parent is deleted but I have not seen parents deleted ever.  Or maybe you are somehow pointing the form to the parent?  Something is off here.  I tested this with 123 but only from AGOL not the 123 website.

Also note Composite will delete but simple will null the keys - which is just as bad.  Check your data for Null keys.

I did post recently that AGOL does not honor simple

I also posted to allow 123 to let us pick the relationship type.  It goes to Composite now.

Hope that helps

0 Kudos