Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Copper Elite Contributor
Posts: 39
Registered: ‎04-14-2009

slxApplicationClass.BasicFunctions.SetCurrentAccountID not picking up running instance

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 ?

Employee
Posts: 629
Registered: ‎04-24-2009

Re: slxApplicationClass.BasicFunctions.SetCurrentAccountID not picking up running instance

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

Copper Elite Contributor
Posts: 39
Registered: ‎04-14-2009

Re: slxApplicationClass.BasicFunctions.SetCurrentAccountID not picking up running instance

Hi Mike,

Adding that registry key hasnt made a differnce and also results in a catastrophic failure error comming from SetCurrentAccountId
Employee
Posts: 629
Registered: ‎04-24-2009

Re: slxApplicationClass.BasicFunctions.SetCurrentAccountID not picking up running instance

[ Edited ]

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