Custom BPM to add QuoteHed_UD field to Sales Order on Opp to Sales Order processing

Hello @bschiefen
We use the same method to convert all our Quotes (from the quote entry screen)
We also have fields to copy across to the OrderHed from the QuoteHed

We use a Method Directive on the Erp.Quote.CreateOrder directive, and use a Post-Processing type

The Post-Processing already has the orderNum variable available in it already

image

image

We added a Custom Code block that has code like this in it (I modified it to suit your fields)

UPDATED - I’ve updated this code based on @timshuwy’s comments below

//Sets SO fields from quote
var quoteNum = Db.OrderDtl.Where(o => o.Company == Session.CompanyID && o.OrderNum == orderNum).Select(x => x.QuoteNum).FirstOrDefault();
if(quoteNum != null)
{
 
   var quote = Db.QuoteHed.Where(q => q.Company == Session.CompanyID && q.QuoteNum == quoteNum).Select(x => new {x.DecorType_c, x.BldgType_c}).FirstOrDefault();       
   if(quote != null)
   {
   //UD fields to copy to SO from Quote BldgType
	using(var txScope = IceContext.CreateDefaultTransactionScope())
	{ 
    var order = Db.OrderHed.Where(o => o.Company == Session.CompanyID && o.OrderNum == orderNum).FirstOrDefault()

      order.DecorType_c = quote.DecorType_c; 
      order.BldgType_c = quote.BldgType_c;
      Db.Validate();
      txScope.Complete();     
    }
}
}