Save data to different company

后端 未结 1 665
轻奢々
轻奢々 2020-12-22 08:42

We\'ve got code to use the Acumatica Web Services inside of an Acumatica BLC, because we want to save data to a different company. I was made aware of another way to do thi

相关标签:
1条回答
  • 2020-12-22 08:53

    To save data to a different company, you should execute your code within PXLoginScope. In the sample below new Stock Item is saved under the NewCompany tenant:

    using (PXLoginScope ls = new PXLoginScope("admin@NewCompany"))
    {
        InventoryItemMaint maint = PXGraph.CreateInstance<InventoryItemMaint>();
        InventoryItem item = new InventoryItem();
        item.InventoryCD = "TEST";
        item = maint.Item.Insert(item);
        item.ItemClassID = "ALLOTHER";
        maint.Item.Update(item);
        maint.Actions.PressSave();
    }
    
    0 讨论(0)
提交回复
热议问题