I there a way to create/call a transaction scope in a form customization for UD tables?
What I’m trying to do is provide our Engineering team a way to “engineer a part” in UD01 before making it an official record in the [Erp.Part] table. Yes, the Engineering team could create the part as an “inactive” part record and then make it “active”… but this is the way they’ve asked me to do it. So, the idea is to build the part record in UD01, then when the part is approved by our Engineering team, a button-click on the UD01 form customization would create a new record in [Erp.Part] using the field data derived from UD01.
What I would like to do is create a transaction scope for the “UD01-to-Erp.Part” data copy process.
I have tried to call a transaction scope from the UD01 customization, but the errors I receive indicate that I do not have the proper assembly reference in place. My references are the following:
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Ice.BO;
using Ice.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;
… and my call looks like this:
using(var txscope1 = IceDataContext.CreateDefaultTransactionScope())
… and I receive the following error:
The name 'IceDataContext' does not exist in the current context
I have also tried the following:
using(System.Transactions.TransactionScope txscope1 = IceDataContext.CreateDefaultTransactionScope())
… which yields an assembly reference error:
The type or namespace name 'Transactions' does not exist in the namespace 'System' (are you missing an assembly reference?)
A comment in this thread seems to indicate that the transaction scope is not available in a UD customization? If so, what are my options to accomplish a “UD01-to-Erp.Part” data copy?