I have a post-processing BPM on SalesOrder.Update that worked. Then I added this code and now I’m getting an error. The code runs when the user checks a UD field checkbox on order entry - and it still works there. But when they check the same checkbox on an updateable dashboard it triggers the error. Any ideas?
string sQueryName= "GetShipToAddress";
var context = (Erp.ErpContext)Ice.Services.ContextFactory.CreateContext();
using (var svc = Ice.Assemblies.ServiceRenderer.GetService<Ice.Contracts.DynamicQuerySvcContract>(context))
{
Ice.Tablesets.DynamicQueryTableset dsQuery = svc.GetByID(sQueryName);
if (dsQuery !=null)
{
Ice.Tablesets.QueryExecutionTableset dsBAQ = svc.GetQueryExecutionParameters (dsQuery);
dsBAQ.ExecutionParameter[0].ParameterID = "OrderNum";
dsBAQ.ExecutionParameter[0].IsEmpty=false;
dsBAQ.ExecutionParameter[0].ParameterValue = OrderNum.ToString();
DataSet results = svc.Execute(dsQuery, dsBAQ);
if(results !=null && results.Tables.Count>0 && results.Tables[0].Rows.Count > 0 )
{
DataRow srow = results.Tables[0].Rows[0];
ShipToAddress = srow["Calculated_ShipToAddress"].ToString();
}
dsBAQ=null;
}
dsQuery=null;
}
Ice.Common.EpicorServerException: BPM runtime caught an unexpected exception of ‘EntityException’ type.
See more info in the Inner Exception section of Exception Details. —> System.Data.Entity.Core.EntityException: The underlying provider failed on Open. —> System.Transactions.TransactionManagerCommunicationException: Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administrative tool. —> System.Runtime.InteropServices.COMException: The transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D024)
at System.Transactions.Oletx.IDtcProxyShimFactory.ReceiveTransaction(UInt32 propgationTokenSize, Byte[] propgationToken, IntPtr managedIdentifier, Guid& transactionIdentifier, OletxTransactionIsolationLevel& isolationLevel, ITransactionShim& transactionShim)
at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken)