07-27-2011 01:26 PM
I'm writing a plugin for some users who work for more than one company, and have more than one ACT db. The plugin cannot interfer with the other databases, and therefore only needs to load for one particular. Which, of course, since they are remotes, are not all named the same thing.
I have an if..then written that looks at an InStr value, but then I'm at the mercy of whoever creates remotes to remember this naming convention (see below).
Is there a way to load just for a specific, or is there another value I can search/compare on such as publisher db name, that will allow this functionality?
Here's what I'm using in testing:
Private Sub ActApp_AfterLogon(ByVal Sender As Object, ByVal e As System.EventArgs) '*****************************************************' '*** Add Handlers for Contact and Company Changing ***' '*****************************************************' Dim dbName As String = ActApp.ActFramework.CurrentDatabase Dim rdbACT As Integer = InStr(dbName, "X2") If dbName = "SvrACTMain" Or rdbACT <> 0 Then ' SvrACTMain is the publisher 'MessageBox.Show("Adding Handlers") AddHandler ActApp.CurrentContactChanged, AddressOf ActApp_CurrentContactChanged AddHandler ActApp.CurrentCompanyChanged, AddressOf ActApp_CurrentCompanyChanged Else 'MessageBox.Show("Removing Handlers") RemoveHandler ActApp.CurrentContactChanged, AddressOf ActApp_CurrentContactChanged RemoveHandler ActApp.CurrentCompanyChanged, AddressOf ActApp_CurrentCompanyChanged End If
07-27-2011 07:08 PM
07-27-2011 08:54 PM
07-27-2011 09:00 PM
07-27-2011 09:26 PM
07-27-2011 10:02 PM
07-27-2011 11:25 PM
Correct, these users are subscribers for all the people they work for - each of their dbs are remote, so I can't just check if it's a subscriber.
I like the idea of either a field value, or even a field name itself - check if exists, then load...
07-28-2011 01:41 AM
Hi Richard,
You could use the SynchronizationManager Class from ActFrameWork.SynchronizationManager.
This Class exposes the following properties:
IsSubscriberDB
PubDBGuid
PubDBID
So if you know the GUID or ID of the publisher(s) you can then run a case ststement on the OnLoad() event?
07-28-2011 02:16 AM