1

I have a FeatureClass A. This Feature Class is Versioned.

User X has a tool open, that reads records from this Feature Class, by clicking a refresh button. The refresh button code is basically a query to the table using this statement

FeatureClassA.Search(null,false);

Another user Z decided to edit the table in a different session. So they open an arcmap session, adds the feature class, starts editing, and creating features.

Once the user finished editing, they save the edit session.

The first user X, clicks the refresh button again, using the same query above, no new Features are brought besides the ones that were already there.

If the user closes the edit session, and reopens it, the new record will show.

How can I make the refresh button get the latest changes from the Feature Class without having to stop and restart the edit session?

2

Depending on your version tree, this answer may be more difficult. Assuming user X and Z are in versions from a common ancestor makes it easier.

Did user Z reconcile and post? This moves their edits "up" the tree. Now user X needs to reconcile to get those edits.

See if this answer helps with some code on reconciling and posting: Reconcile and post with c#

Hard to tell what language and/or version of ArcGIS you're using.

1

IVersion Interface is where the answer lies, all I had to do was get the workspace from the feature class, and then cast that to an IVersion, and then called Version.RefreshVersion

public void RefreshCurrentVersion(IFeatureWorkspace versionedWspace){
var version = versionedWspace as IVersion;
     if(version!=null){
       version.RefreshVersion();
     }
   }

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.