Search code examples
c#processsaleslogix

Trying to control open application, instead opening new application


Was tough to make a title that made sense.

So I am working with SalesLogix CRM and trying to navigate to a contact in said CRM. Saleslogix allows you to use almost like a url that looks like slx:CONTACT//C6UJ9A006S96

That line will direct the CRM to the contact with that ID.

My problem is when I try to navigate to that url I open a new SalesLogix instance instead of using the current one.

Saleslogix is a desktop based software just for your information.

The strange part for me is that if I use Windows' 'Run...' from the start menu and put in slx:CONTACT//C6UJ9A006S96 then it will use the already open application, same with a normal command prompt, however if I use an Admin command prompt it will open a new instance of SalesLogix. I checked the task manager and it doesn't matter if I open it using the admin command prompt or just the desktop window, it will say it is running under my current user and not system or anything weird so it seems the user isn't the problem.

My code is:

Process[] processes = Process.GetProcesses();
        foreach (Process p in processes)
        {
            if (p.ProcessName == "SalesLogix")
            {
                p.StartInfo.RedirectStandardOutput = true;
                p.StartInfo.UseShellExecute = false;

                p.StartInfo.FileName = @"C:\Program Files (x86)\SalesLogix\SalesLogix.exe";
                p.StartInfo.Arguments = "slx:CONTACT//C6UJ9A006S96";
                p.Start();
            }
        }

Any help would be appreciated and if I didn't explain my problem clearly enough I would be happy to clear up any confusion.


Solution

  • Try running the URL directly. As in, don't execute the SalesLogix exe, just pass the URI as the filename and let the Windows protocol handler take care of it.