Select to view content in your preferred language

AGOL toggle on "Enable Attachments" in hosted feature layer polygon layer results in error message

726
6
03-06-2024 08:29 AM
KimT
by
New Contributor

I'm working with a hosted feature layer polygon layer in ArcGIS Online.  When I try to toggle "Enable Attachments" to ON I get this error message:

KimT_0-1709741927847.png

I have other similar layers that have no problem toggling "Enabling Attachments" on or off. I cannot figure out what is different about this layer.  I'm checking all of my settings and they appear to be the same as other layers that allow me enable attachments.  Any ideas why this layer won't allow me enable attachments?

6 Replies
ShaneONeill_144
Esri Contributor

Hi Kim,

I'm sorry to hear that you are facing this issue!

I've tested with a few layers of my own and I haven't been able to recreate the issue, just to confirm, is this the only layer that you are having this issue with?

Are you able to republish the layer to AGOL to see if the issue still occurs in the newly published layer?

Can you share the layer with me via an AGOL group so I can take a look at it? My username is soneill@esriuk.com_TechsupportUK

KimT
by
New Contributor

This is the only layer I'm having trouble with.  All of my other similar layers are allowing me to enable attachments.  I tried republishing the layer and I still have the same issue with the newly published layer.  I will share the layer with you.

The only thing I can think of that makes this layer different from my other similar layers is the layer I'm having issues with was created by making an independent copy of an existing layer that became a feature layer and was then published as this hosted feature layer. So this hosted feature layer is still dependent on that independent copy/feature layer.  Would that cause this problem?

tfield
by
New Contributor

I am having this same problem after doing the same thing (the copying layer thing). @ShaneONeill_144 , are you still able to help with this issue? I can share my layer with you.

KansasDASC
Regular Contributor

@ShaneONeill_144 @KimT @tfield  Any update on this. I seem to have discovered that it's affecting our workflow to update a AGO hosted feature layer and related tables. I have published the same GDB as a FL in a different folder and can toggle attachments, but the one I'm working on can not. The error I get is "Unable to update feature service layer definition."

We are making updates to the FL through the API for Python. In the code we are making changes to the service definition to make sure that after each overwrite, the layers are still Sync-enabled, Edit-enabled, and select capabilities. Without updating the SD, these options revert and we have to change them manually, hence the code.

When I try to update the SD in the code with something like:

TABLE.manager.update_definition({"hasAttachments": True})

I just get this error: "Unable to update feature service layer definition. There are no primary or candidate keys in the referenced table..."

LindseyGreidanus
Occasional Contributor

I just had this issue as well, following the steps describe here to create an independent copy of a feature layer in AGOL.

The page does mention that related tables will not work, which is what the attachments on a feature layer is based on.

I got the same error updating layer warning when I tried to enable attachments, but when I had a call with ESRI support we were not able to replicate the issue on a fresh feature layer. I tried replicating it again after the call with the settings changed from the default and that seems to be what caused the issue - I got the error message again.

The recommended work-around was to save the layer as a FGDB and then republish it again from Pro. 

0 Kudos
KansasDASC
Regular Contributor

I have suspected that part of the issue, which might explain why republishing or trying a brand new FL works, is that after we publish the FL, we use the Python API to make changes to the service definition so that certain capabilities are always on or off, and not the defaults. We also create a number of field domains. I don't know if these SD changes impact the attachments toggle?

0 Kudos