Kinetics BPM SetCompany and SetPlantID

                            // Need to switch to the receiving company and plant -- worked in E10
                            this.Session.SetCompany("ABC");
                            this.Session.PlantID = "XYZ";

This code had worked in E10, but does not in E11. I receive the following errors. What is the equivalent in Kinetics?

Please try

Ice.Core.Session s1 = (Ice.Core.Session)this.oTrans.Session;
s1.CompanyID = "ABC";
s1.PlantID = "B";

He’s in a BPM/UBAQ/Function etc.

You might want to peruse this thread:

This may also work, unsure if any drawbacks.

  var ehsSession = (Epicor.Hosting.Session) Session;
  
  ehsSession.SetCompany("ABC");
  ehsSession.PlantID = "XYZ";
``

Good thread, everyone should read it.

2 Likes

Thank you much. I was struggling with this and it had worked what was posted.

1 Like