Creating records in other companies

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