preloader-matrix

Alfasith

Extend / Customize standard CanSubmitToWorkflow in D365

Hi,

We cant override CanSubmitToWorkflow to return our boolean on any eventHandler’s return like eventHandler of ValideWrite(). To achiew we have to set the args of CanSubmitToWorkflow() to be decided by our code.

[PostHandlerFor(formStr(CustTable), formMethodStr(CustTable, canSubmitToWorkflow))]

public static void CustTable_Post_canSubmitToWorkflow(XppPrePostArgs args)

{

FormRun     form = args.getThis();

FormDataSource      custTable_ds = form.dataSource(formDataSourceStr(custTable,CustTable)) as FormDataSource;

custTable           custTable    = custTable_ds.cursor();

if (custTable.RecId && custTable.DocumentStatus == DocumentStatus::NotSubmitted)

{

args.setReturnValue(true);

}

else

{

args.setReturnValue(false);

}

}

 

Regards,

Share on email
Share on facebook
Share on twitter
Share on linkedin
Share on pinterest

Leave a Reply

Your email address will not be published.