How to add new fields in workflow configuration by using x++ code.

How to add new fields in workflow configuration by using x++ code.

In this case i will take example of one out of the box workflow "Project budget revision workflow". We have one requirement that have to set different approvals on the base of revision change amount and Project group. All the amount calculated fields are available in that workflow configuration but project group was not available. So i decided to get the project group by using existing Project id. To achive this requirement we have to write code in the workflow document class in which "getQueryName()" method exists.

It is very simple and easy, steps are mentioned below:

1- Create extension of workflow document class.

2- Add parm method in this class which will return the Project group id.

3- Do build and synch(synch is mandatory). Check the configuration field will be available there.


Code snap is given below:

No alt text provided for this image

Result is given below:

No alt text provided for this image

Be Happy:

Muhammad Uzair Shah

Cloud Solution Architect - Business Applications at Microsoft

1 年

Just a question. Why you didn’t add a field on the Workflow Document Query itself using extension under AOT-> Query -> YourQueryObject if you want to add a new placeholder in Workflow configuration.

Khawaja Muhammad Bilal Kashmiri

A.F. Solution Architect》MCP 》MS Dynamics AX & D365 F&O 》Supply Chain Professional》Gold Medalist 》Hospital & Lab MIS 》Retail Applications 》Integrations 》Customized ERP 》Power Automates

1 年

Thanks for posting!.

要查看或添加评论,请登录

Muhammad Irfan Ayoub的更多文章

社区洞察

其他会员也浏览了