edit a feature attribute in versioned dataset and update label of feature

558
2
04-12-2012 08:47 PM
Highlighted
New Contributor II
I am tryign to create an arcmap tool which will update an attribute (the attribute that is used to display labels in arcmap) of a versioned featureclass and will show the updated value on the label of that feature before actually saving the feature ....


i have this scenario -
i have a versioned datasets and I have two versions -version1 and version2 of that dataset. Now, user has arcmap document and has added the featurelayer of version1.  Now, the user will manually start an editsession(by clicking on editor -start edit session) and select version1 as version to be edited ..

Next thing user will do is select features in that versioned feature-layer(by dragging rectangle etc) . then user clicks on my tool and mytool should update an attribute-field of my featureclass (just for that particular version - version1 ). My tool should not yet save the changes to the feature class, i.e. it should not end the edit session-i.e. it should not do myWorkspaceEdit.StopEditing(true);

I tried -

//edit session is already started by the user
myworkspaceedit.starteditoperation();

//update my feature attribute
myfeature.set_value(myfield)="mynewval";
myworkspaceedit.stopeditoperation();

//my code will not close the edit session and save the edits... User will manually click on Editor-->stop editing blah blah...

after doing that, it does not change the label on the feature... myfield is used to label the feature-layer in my arcmap document.. why it is not updating the label?

am i missing something? , do i need to do myfeature.store(), i thought myfeature.store() is for nonversioned data
pl help
Reply
0 Kudos
2 Replies
Highlighted
Esri Regular Contributor
Yes, you need to call store after changing the value. Store pushes the changes back to the geodatabase, in this case your edit session delta tables.

See also, the editor topic Updating attributes of existing features
and the geodatabase topic Updating features
Reply
0 Kudos
Highlighted
New Contributor II
thank you so much, it worked....
Reply
0 Kudos