Select to view content in your preferred language

FeatureLayer.AllowNew returns false. How to create a cache which is editable.

490
1
07-30-2010 02:02 PM
Jitendrudulacaraju
Emerging Contributor
am using an editor user name on a SDE SQLServer database connection.

A Map Document is created using the data with the connection above.

A map service is created on the arcgis server with mobile capabilities.

A mobile cache is created from this service.

In the application I have to edit feature layers from the cache.

In the code I have put a check FeatureLayer.AllowNew for which I get a Boolean FALSE. So I have to exit the code.



The Question is : How to create a service cache on which the FeatureLayer is editable. And I get the AllowNew as True to proceed further.


Code Block:
internal void AddVertex(object o)
{
selectedMobileMapServiceLayer = CoM_SWToCModule.ToCViewModel.SelectedMobSvrMapLayer;
if (selectedMobileMapServiceLayer == null)
{
MessageBox.Show("Select Feature From The ToC");
return;
}

selectedFeatureLayer = selectedMobileMapServiceLayer.Layer as FeatureLayer;

  if (!selectedFeatureLayer.AllowNew) >>>>Returns FALSE
{
MessageBox.Show("Geometry in " + selectedFeatureLayer.Name + " is not editable");
return;
}
0 Kudos
1 Reply
MaximilianGlas
Esri Contributor
Did you create a GLOBAL_ID field on the FeatureLayer to be edited? That is essential for editing.
0 Kudos