BPM External Method - callContextBPMData

I’m having a go at creating an external assembly to create some reusable code to use for dating sales order releases on ‘SalesOrder.ChangeSellingQtyMaster’.

I’ve used the ‘Create Programming Interface’ to give me this template:

public void ChangeSellingQtyMaster(
Erp.Tablesets.SalesOrderTableset ds,
ref System.Decimal ipSellingQuantity,
ref System.Boolean chkSellQty,
ref System.Boolean negInvTest,
ref System.Boolean chgSellQty,
ref System.Boolean chgDiscPer,
ref System.Boolean suppressUserPrompts,
ref System.Boolean lKeepUnitPrice,
ref System.String pcPartNum,
ref System.String pcWhseCode,
ref System.String pcBinNum,
ref System.String pcLotNum,
ref System.String pcDimCode,
ref System.Decimal pdDimConvFactor,
ref System.String pcMessage,
ref System.String pcNeqQtyAction,
ref System.String opWarningMsg,
ref System.String cSellingQuantityChangedMsgText)
{

And managed to get hold of the Db and Session objects through:

private readonly Lazy db = new Lazy(() => CallContext.Current.GetMainContext());

    private ErpContext Db => this.db.Value;
    private readonly Session session = CallContext.Current.Session;

But I’m struggling to get access to the callContextBpmData.

What do I need to add?

I’ve read through some previous posts suggesting passing things through to the new method but I can’t see how to do that.

Looks like I’ve solved it:

    private BpmContextWrapper bpmContextWrapper => (BpmContextWrapper)CallContext.Current.BpmContext();
    private BpmDataRow callContextBpmData => this.bpmContextWrapper.BpmData;
1 Like