Skip to main content

Posts

Showing posts with the label Workflow

Add a new starting worker for workflow hierarchy approval #MSDyn365FO

This is very simple but not too obvious. There are times when you want to start the hierarchy approval with a specific worker and then have it traverse up the hierarchy. See screenshot below screenshot of some of the options. You may want to add something different to what is already available. The way it works is, it uses certain EDTs on the table. So, all you need to do is add a field that extends one of these EDTs. Or just subscribe to the delegate to add another EDT. Below is some code that could give inspiration.

Add Spending/Approval limit to Purchase Order Workflow #MSDyn365FO

I feel this is very limiting when you try to use purchase order workflow via hierarchy assignment. The set up is there but you really can’t use it to the end. When you try to set up a stop condition, you can’t really use it. Vote for the idea for Microsoft to develop this. https://experience.dynamics.com/ideas/idea/?ideaid=6b55a93d-7235-e811-bbd3-0003ff68aa57 Below is a screenshot of how I have added it. NOTE: Screenshot shows the field. However, I should have shown it using the automatic actions. To show that it is available to have an auto approve if spending limit of the requester is above the limit. To add these fields or any dynamic (calculated) field is very simple. Just a parm method to the workflow document class. For this example, I just copied the parm method and made it point to the PurchTable. Copy from PurchReqDocument to PurchTableDocument Here is a class I put together to show you how I added the spending limit. https://github.com/munib00/WorkflowPlus/blob/mas...

Approve Workflow via email using template placeholders #Dyn365FO

Dynamics 365 for Finance and Operations has placeholders which can be inserted into the instructions. Normally you would want this to show up in the email that is sent. One of the most useful ones is the URL link to the exact record that you are approving. In the workflow configurations use the placeholder and build up your message. Towards the end it has workflow specific ones. The URL token is %Workflow.Link to web% . For the technical people the token is replaced in this class WorkflowDocumentField. This is what I inserted into my email template. <BODY> subject: %subject% <BR> message: %message% <BR> company: %company% <BR> for: %for% <BR> </BODY> Should look like this. The final result looks like this. If you debug these are the place holders that are put together.

Workflow hierarchy limit checker for D365FO

A couple of years back I wrote a post on a workflow hierarchy limit checker job . It was a simple job that took a starting worker and traversed up the hierarchy. It printed the userid/worker/position/manager/spending limit/approval limit in an info log. Today I rewrote it slightly to use a dialog for D365FO. Since it is not possible to change the code that easily in D365. This currently only works for Expenses. Its not pretty at the moment but it works. I intentionally left the error in there. This will print the same error as what the workflow engine would. Hopefully this would give you a clue on where it stops. Hopefully I can come back and extend it to the other document types such as purchase requisition and purchase orders. Code is available on GitHub . I gave it a generic name like “Workflow plus”. I hope to add a few other nice commonly used workflow enhancements to it. Another common enhancement I can think of is - Purchase order spending and approval limit; currently you don’t...

Workflow configurable hierarchy #D365O

This was a nice find in the latest version of D365O. In workflow we can associate a hierarchy to a configuration. In pervious versions we where only allowed to select the one primary managerial hierarchy. A slider will pop up which you can select a hierarchy. In the assignments in AX 2012 we where only allowed to select the Managerial hierarchy. In D365O we can select Configurable hierarchy.

Workflow hierarchy assignment common errors explained and tester job [AX 2012]

Workflow hierarchy assignment has a lot of interdependent data that must be set up. If one of those is missing or is incorrect – the processor will just error out. Sometimes with very little information or confusing errors. Below is an example of an error that is not very well written. It doesn’t tell you which record failed. Someone went into the effort of creating the labels correctly but did not use it properly. Here are some common errors you would get while processing the workflow. “The hierarchy provider did not return any users.” – Next Position was not found. “Worker not found for position ID %1.” – No worker is attached to a position. Go to the worker and make sure they have a primary position. If no primary position exists, then the system will find the oldest position (one with the earliest start date). Also make sure the worker is an employee of the company to submit the workflow. “User not found” – User not found for the worker. Check the user relations. “User...

Stop workflow submitter from approving [AX 2012 R3 CU8]

This is a common request in previous versions of AX. Usually you would want to stop the submitter from approving their own workflow. Dynamics AX 2012 CU8 has introduced a new flat on the Workflow parameters. “Disallow approval by submitter”. This is a global setting and not workflow specific. To test this out I created a user group with 2 users. One of them being my account. I created a workflow for journals and used Role based assignment to the APTeam user group.   I was allowed to submit it but I found the workflow history had an error. ie Submitter cannot be the approver. I understand why Microsoft has done it this way but I am not a big fan of it. I don’t like introducing errors in the workflow history. It makes the workflow configuration very difficult. Lets say you had a team of 5 users. Each one was able to submit but not approve their own journals. Then you would have to create a complex workflow configuration to deal with all the combination. I have done similar...

Workflow error: "User 123 has no access to menu item PurchReqTable"

I recently was helping a client set their security and I found a weird one. The workflow would stop with an error "User 123 has no access to menu item PurchReqTable". This even though they already had access to all the workflow menu items and the purchase requisition form. The key that is required is the Miscellaneous key.

Microsoft Dynamics AX 2009 on iPhone

I am passionate about this topic as I have been working on it for a while with the team in my company. We have developed an iPhone solution for Microsoft Dynamics AX which allows users to do the following: Workflow approval - View and action workflow. eg. Approve/Reject  Alerts - Receive/view notifications  Entities - Browse records in AX - this is extendable to allow you view any record in AX. We have basic records like Customers, Items etc by default but this is extendable Here are some screenshots: Main Menu on the iPhone Alerts on the iPhone On the iPad Finally, here is a video I have uploaded to youtube. Instead of showing you an emulator or just screenshots. This video is straight of my iPhone. Its not the best video quality but hope it gives you the concept of this mobile solution. Here is a link to my companies website: http://www.eclipsecomputing.com.au/Services/EclipseMobility.aspx

AX - Workflow troubleshooting

Microsoft released a troubleshooting document for workflow on customersource/partnersource. How to troubleshoot common workflow issues for Microsoft Dynamics AX 2009 https://mbs.microsoft.com/customersource/documentation/howtodocuments/ax2009_workflow_tips.htm

AX - Install multiple workflow instances for Dynamics AX 2009

The standard install for AX2009 and AX2009SP1 does not allow you to run multiple workflow instances on the one machine. There is a KB article which explains how to do it. It requires an install. https://mbs.microsoft.com/knowledgebase/KBDisplay.aspx?scid=kb;en-us;960801 After the install you essentially copy the workflow folder, virtual directory and application pool in IIS. Create your config file (*.axc) and point the web.config file to it.

AX - Workflow notification

Just an FYI. If you have a system with multiple companies. You want to view all your workflow notifications in the role centre. Right? Well thats how it works. If you are in the company where the document exists. You will get this when you right click: If you are in the other company. You will get this:

AX - Workflow - Direct approver

Requirement: Can you send a direct workflow approval request to an employee in the system? You can’t do it in standard workflow. I.e. Can the user select who to send it to. Rather than the template determining it by Role/Hierarchy or specific user. Solution: You can do this very easily witha simple mod. In this example we will look at purchase requisition workflow. 1. Add a new field to the purchase requisition header. Called “Direct approver” (Employee table). 2. Create a new class called with the following methods public class PurchReqWorkflowParticipantProvider extends WorkflowUserGroupParticipantProvider { } public WorkflowParticipantTokenList getParticipantTokens() { WorkflowParticipantTokenList tokenList = WorkflowParticipantTokenList::construct(); ; tokenList = super(); //Hardcoded to make it a readable tokenList.add('DIRECTAPPROVER', 'Direct approver'); return tokenList; } public WorkflowUserList resolve(WorkflowContext _conte...