Open a form in a different company than the one you are in (not using shortcuts)

Is there a way to launch a form in a different company than the one you are in? I have a cross company Dashboard, which displays data from 3 different companies. What I would like to do is open up the Credit Manager form using the Billto of the item displayed on the dashboard, with the company that the item belongs to. Currently, it opens with the Billto but it’s always in the current Company, not with the Company of the item.

Following this. That would be very useful for us too!

It would require custom code, not using the standard Open With but rather a custom piece of code that temporarily changes your company invokes the form and changes it back. I’ve done it before, I believe we’ve discussed it here before too.
Let me see if I can find it.

Edit: Found it

1 Like

This looks close to what I want, but I want to change CompanyID, not PlantID. One person needs has access to 3 companies which we display on the dashboard (all 3 have different currencies) and we want to be able to go to the Credit Manager for the Company the Billto belongs to. It choked when I tried using similar code with CompanyID.

Just change the Company field instead of the Plant field. Same thing

I tried that. What happened is Epicor said I don’t have access to that Company (I do, it was one belonging to the Company I was already in) and crashed severely, as in completely out of Epicor.
Apparently it’s not that simple to change Companies.

I just ran a test and it appears to work fine (assumes “ELIM” is the other company and “MfgSys” is the plant in the other company:

	private void btnTest_Click(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **
		var session = (Ice.Core.Session)oTrans.Session;
		var othsession = Ice.Lib.Framework.FormFunctions.SessionCache.GetCachedSession(session.AppServer, "ELIM", "MfgSys");
		var newJobNum = "";
        LaunchFormOptions launchObject = new LaunchFormOptions()
          {
              IsModal = false,
              SuppressFormSearch = true,
              ValueIn = newJobNum,
              
          };
		var othlaunch = new ILauncher(othsession);
        ProcessCaller.LaunchForm(othlaunch, "PJGO1010", launchObject);

	}

Ah, I see the issue. I didn’t know I needed to use MfgSys as well. Fortunately we can hardcode that since that’s all we ever use. I tried it and it works beautifully, thank you so much!

2 Likes