I need to create a BPM, that when the sales order is created from a quote, a UD field is filled with a value. I have created one that is activated when the sales order is created from the Sales Order Entry form, there is also a Method BPM that is activated using the SalesOrder.CreateOrderFromQuote, but it has not worked for me and I think this is activated when use through actions. Actions → Quote → Create Sales Order, but what I need is for it to be created from the Tasks tab when the Create Sales Order box is activated. I have used tracing, but there are only task update methods.
Hi
You need to create a Post-Processing Method Directive on Erp.BO.Quote.CreateOrder
Step 1: Create a variable vOrderNum
Step 2: Populate the variable with the order number from the data set
Step 3: Add a custom code node and enter the appropriate code to update the Sales Order record
Here is an example of where I am setting the Firm Release flag to FALSE for all Sales Orders created from a Quote to get you started the section in italics is where you need to add your UD field update if the field is on Order Rel.
using (var txScope = IceContext.CreateDefaultTransactionScope())
{
foreach(var ORL in (from row in Db.OrderRel.With(LockHint.UpdLock)
where row.Company == Session.CompanyID && row.OrderNum == callContextBpmData.Number01
select row))
{ ORL.FirmRelease = false;
}
Db.Validate();
txScope.Complete();
}