Community
Showing results for 
Search instead for 
Do you mean 
Reply

Last Synchronized Date

Nickel Elite Contributor
Posts: 508
Country: USA

Last Synchronized Date

Is this a property that can be retrieved, or just something that needs to be queries from a table? I could not find it in the SDK reference, but maybe I was looking in the wrong area.  Thanks...

Richard Brust
ACT! Certified Consultant
richard@rbrDataSolutions.com
Nickel Elite Contributor
Posts: 937
Country: USA

Re: Last Synchronized Date

 

This looks like it's available in the OLEDB2 Provider as the column name:

SEND_SYNC_STATUS

 

in the table (view):

SYNC_DBMAP_INFORMATION

Employee
Posts: 1,163
Country: USA

Re: Last Synchronized Date

Allen is correct, the Act.Framework.Synchronization namespace has a SyncDB class that contains a LastSuccessSyncDate property that should return what you're looking for also.

Matthew Wood
Act! SDK Support
Community Moderator
Nickel Elite Contributor
Posts: 508
Country: USA

Re: Last Synchronized Date

I've tried that property, but I get null for all databases (remotes) I've run the plugin on.  Here's the example:

 

 

Dim syncDBClass As SyncDB
Dim syncDate As Date

Dim bSubscriber As Boolean = ActApp.ActFramework.ActDatabase.IsSubscriber
'MessageBox.Show(bSubscriber.ToString())

If (bSubscriber = True) Then
  Try
    syncDate = syncDBClass.LastSuccessSyncDate
    MessageBox.Show(syncDate)

...and so on

 

 

Richard Brust
ACT! Certified Consultant
richard@rbrDataSolutions.com
Employee
Posts: 1,163
Country: USA

Re: Last Synchronized Date

Has the remote that your attempting to gather the last sync date from sync'd? The value should not be null if the remote has sync'd. Here's what's working for me:

 

System.DateTime SyncDate;
SyncDB[] Remotes = ActApp.ActFramework.SynchronizationManager.GetAllRemoteSyncDBs();
SyncDate = Remotes[0].LastSuccessSyncDate;

 

This database only has a single remote.

Matthew Wood
Act! SDK Support
Community Moderator
Nickel Elite Contributor
Posts: 508
Country: USA

Re: Last Synchronized Date

Maybe I'm mixing things up (or not asking correctly) - what I'm looking for is running on the remote itself, not the server.  I'm trying to get info via a dll as a Plugin on a remote user's db.  Thanks...

Richard Brust
ACT! Certified Consultant
richard@rbrDataSolutions.com
Employee
Posts: 1,163
Country: USA

Re: Last Synchronized Date

Having a similar issue when trying to do this from the remote. I can capture the remote as a SyncDB, but the last success date always returns 1/1/0001.

 

Expire days is accurate on the remote, as a work around we could subtract 30-expire days (if it was set to expire in 30 days) and then subtract that from System.DateTime.Now.

 

Of course, Allen's approach at this point might be easier.

Matthew Wood
Act! SDK Support
Community Moderator
Nickel Elite Contributor
Posts: 508
Country: USA

Re: Last Synchronized Date

I know how to get data via OLEDB[2] from outside programs like Excel, Dashboards, and the like - are there any SDK examples of using a query? Just something I haven't done yet, thanks...
Richard Brust
ACT! Certified Consultant
richard@rbrDataSolutions.com
Nickel Elite Contributor
Posts: 937
Country: USA

Re: Last Synchronized Date

Nickel Elite Contributor
Posts: 508
Country: USA

Re: Last Synchronized Date

Thanks both Allan & Matthew - I got it working, but then realized I wanted this to be available to older versions, at least back to 2007, which does not have OLEDB2 [and I'm guessing because I'm building against older dlls, that the line:
Dim actCon As OleDbConnection = New OleDbConnection(ActFwk.CurrentACTOLEDB2) is not available, only Dim con As OleDbConnection = New OleDbConnection(ActFwk.CurrentACTOLEDB)]

Back to the drawing board - I really wish it was just a property somewhere - when a user goes to sync, where does the "Your database is updated through..." line come from? (this user happens to be on 2009)
Richard Brust
ACT! Certified Consultant
richard@rbrDataSolutions.com