Select to view content in your preferred language

Truncating FL with Relationship Classes Fails

217
0
03-27-2025 10:34 AM
KansasDASC
Frequent Contributor

I have published a FL to AGO that has 12 tables with relationship classes. For data updates, I was doing an overwrite using the Python API and it was working fine, but after doing some research and chatting with Esri staff, it was recommended that we change this update process to a truncate/append. I have successfully truncated the 12 tables and can append data updates back into the hosted tables, but when I try it on the feature layer, I get an error in Python: "Unable to truncate layer data". Additionally, the error shows: "There are no primary or candidate keys in the referenced table 'user_75432.TABLE1' that match the referencing column list in the foreign key 'REL_FK_TABLE2_0'. Could not create constraint or index. See previous errors.
(Error Code: 400)"

When I build the relationship classes with Python, they seem to build ok when testing them, but wondering if and why this would prevent the truncate one one layer, but not on the tables? I have tried enabling/disabling the sync and edit options at the FL level, but still get the above error.

0 Kudos
0 Replies