Select to view content in your preferred language

Non-editable Layer

2803
3
08-16-2010 02:23 PM
AlexProtyagov
Emerging Contributor
For some reason all feature layers of my mobile cache are read-only. Would you know what
needs to be done in order to be able to add values (points, polylines, etc) to a feature layer ?  My suspicion is that I need to setup something in my map document, mxd file. Or perhaps when I make the cache I need to do some extra step?

In the following code I get exception that the feature layer is not editable:

            // Selects a specific cache layer
            FeatureLayer featureLayer = _cacheData.Layers[0] as FeatureLayer;
            // Gets the feature layer data table schema
            FeatureDataTable featureDataTable = featureLayer.GetDataTable( );
            // Creates a new row
            FeatureDataRow featureDataRow = featureDataTable.NewRow( ); 

Last line raises exception "The target feature layer does not allow creation of new features."
0 Kudos
3 Replies
MaximilianGlas
Esri Contributor
To check if it is possible to edit data you can use
if (featureLayer.AllowNew || featureLayer.AllowModify)
{
}


The only condition for editing data is an existing GLOBAL_ID field in the feature class. You can add it in ArcCatalog.
0 Kudos
AlexProtyagov
Emerging Contributor
Thank you. That appears to be the only way, the GLOBALID on the feature class. When I did that it was editable on mobile just fine.

Just for curiosity, - is it possible to make an editable layers for mobile devices from shape files? Somehow when I make a layer from a shape file it read-only on mobile. However, it is ok since I can edit SDE feature classes derived from oracle db.

Obviously a feature class built from a database view does not support globalid simply because views are not editable. Is there a trick to make a feature class derived a view editable on mobile device. The  idea is that the layer only gets downloaded to the device, it never gets back to database via Sync method. Again, I am just curious on that part
0 Kudos
EzequiasRodrigues_da_Rocha
Regular Contributor
To check if it is possible to edit data you can use
if (featureLayer.AllowNew || featureLayer.AllowModify)
{
}


The only condition for editing data is an existing GLOBAL_ID field in the feature class. You can add it in ArcCatalog.


I think the Operation Allowed in ArcGIS Server Mobile Service must be ON (to insert/delete/update). Are you agree with me?

Regards
Ezequias
0 Kudos