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?

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Feb 4, 2019 at 15:22
0

2 Answers 2

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.

answered Feb 4, 2019 at 16:14
0
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();
 }
 }
answered Feb 6, 2019 at 8:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.