Questions about geodatabase feature attachments

372
1
Jump to solution
05-22-2022 06:39 PM
ShiminCai
Occasional Contributor III

Hi All,

We are using AGSGeodatabaseSyncTask to generate offline geodatabases. In the generated geodatabase we don't want to include existing feature attachments. To do this, we set the AGSGenerateGeodatabaseParameters.returnAttachments = false.

My first question is: am I able to add attachments to the features in the generated geodatabase?. Here is my post about the issue a few years back: https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/offline-geodatabase-attachments/m...

My second question is: how do I determine if a layer is enabled with attachment capability? Because we set AGSGenerateGeodatabaseParameters.returnAttachments = false, I have noticed that the AGSArcGISFeatureTable.hasAttachments is always false even though the feature layer in the feature service is already enabled with attachment...

Thanks,

Shimin

0 Kudos
1 Solution

Accepted Solutions
ShiminCai
Occasional Contributor III

Hi All,

We figured it out:

1. set AGSGenerateGeodatabaseParameters.returnAttachments = false to not include existing attachments.

2. set AGSGenerateGeodatabaseParameters.attachmentSyncDirection = AGSAttachmentSyncDirection.upload.

3. AGSArcGISFeatureTable.hasAttachments will be true if the layer in the feature service is enabled with attachment.

Then we are able to add attachment to features offline.

Cheers,

Shimin

 

View solution in original post

1 Reply
ShiminCai
Occasional Contributor III

Hi All,

We figured it out:

1. set AGSGenerateGeodatabaseParameters.returnAttachments = false to not include existing attachments.

2. set AGSGenerateGeodatabaseParameters.attachmentSyncDirection = AGSAttachmentSyncDirection.upload.

3. AGSArcGISFeatureTable.hasAttachments will be true if the layer in the feature service is enabled with attachment.

Then we are able to add attachment to features offline.

Cheers,

Shimin