Creating records in other companies

Hello,
I have the following challenge : when linking a global part, I need to create a partwhse for the warehouses in all other companies (either using internal of external bpm).
The problem here is, I guess, how do I create a partwhse record in another company than the current one ?
Any suggestions?

Regards,
John

Here is one way to accomplish if using a BPM. Replace COMPANYID with the desired company or pass variable that contains the destination company

using (CallContext.Current.TemporarySessionCreator.SetCompany("COMPANYID").Create())
{
      Insert Logic Here
}
3 Likes

Hi Dan,
Thanks for your answer.
Apparently I need references to assemblies in order to accomplish this. Do you happen to know which ones?

Regards,
John

John,

Did you ever get an answer for this? I am working on this now and have created a user form for the creation of a part in the other company. I could use some help with it if you have something in place.

Thanks!

Hi Marykay, Sorry, but I (still) do not have an answer how to do this.
I have not spent more time on it, though.

John

I believe I have found a solution client side, see my post if it helps:

Thank you Tanner. I have flagged your post and definitely will be looking into this sometime next week. Right now I have to load data into a new company. Then I have to have a working form for the other company to create parts in the currently existing company. This will be very helpful!