03-06-2014 08:03 AM
We have an external .Net application which is calling the BasicFunctions.SetCurrentAccountID which with v8 is not picking up the currently runing instance of saleslogix and instead starts another one.
Is there anyway to pickup the currently running instance ?
03-06-2014 08:59 AM
Hi,
In order for the single instance logic to work [one] of the following must be true when the process is started:
1. There should be a DWORD entry named OneInstance under HKEY_CURRENT_USER\Software\SalesLogix\Client with a value of 1.
2. The Saleslogix.exe process must be started with a command line that includes /SINGLETON as the second command line option.
Thanks
Mike
03-06-2014 09:55 AM
03-06-2014 02:11 PM - edited 03-06-2014 02:16 PM
Hi,
It sounds like you may be calling SetCurrentAccountID before the application is ready? The application Sate must return ApplicationState.asReady before you can make such a call. The following is a quick and dirty implementation (also, be sure to rebuild the Interop.SalesLogix.dll, etc. for your version of SalesLogix.exe).
Example (not a real world example...you would never want a while statement like this, but you get the idea):
ISlxApplication slx = null; try { slx = new SlxApplication(); while (slx.State != ApplicationState.asReady) { Thread.Sleep(1000); } slx.BasicFunctions.SetCurrentAccountID("AA2EK0013034"); } finally { if (slx != null) { Marshal.ReleaseComObject(slx); } }
Thanks
Mike