Показать сообщение отдельно
Старый 25.08.2023, 20:14   #1  
Blog bot is offline
Blog bot
Участник
 
25,487 / 846 (79) +++++++
Регистрация: 28.10.2006
dynamicsaxinsight: D365FO: Submit pending vendor invoice to workflow in X++
Источник: https://dynamicsaxinsight.wordpress....workflow-in-x/
==============

Purpose:

In this post we’re going to learn how can we submit a pending vendor invoice to approval workflow in X++.

Application:

Dynamics 365 for Finance and Operations

Business requirement:

Submit a pending vendor invoice to approval workflow in X++.

Solution:

We can use the code below to submit a pending vendor invoice to approval workflow.

Code

/// /// Submits vendor invoice to workflow./// public static void main(Args _args){ WorkflowComment workflowComment; TradeLineRefId headerReference; VendInvoiceInfoTable vendInvoiceInfoTable; headerReference = "COMP-011202"; workflowComment = "Auto submission to workflow."; vendInvoiceInfoTable = VendInvoiceInfoTable::findTableRefId(headerReference); if (vendInvoiceInfoTable) { try { VendInvoiceHeaderWorkflow::submitToWorkflow(vendInvoiceInfoTable, workflowComment); } catch (Exception::CLRError) { System.Exception interopException = CLRInterop::getLastException(); error(strFmt("%1", interopException)); } catch (Exception::Error) { error(strFmt("An error occured during the update.")); } }}


Источник: https://dynamicsaxinsight.wordpress....workflow-in-x/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.