Skip to main content


Showing posts from December, 2017

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

Run a class in background–Asynchronies mode

This is not much of a new thing but a reminder. I feel it should be used more often in D365fFO. In prior versions we showed a progress bar and gave the user a nice feeling that something was processing. In D365fFO we need better a way. If you look at the Data Management, it has a workspace for this. Process runs in async and workspace shows us the status. Code wise, it is pretty simple. Below is an example from standard code. I got it using “Find reference” feature in Visual Studio. Any info or error messages will appear in the message centre. This is great as the user can continue doing their job without waiting. Why am I writing about this? I had a project recently where the a process was taking minutes to run. Based on the amount of data and what it was doing, I found it acceptable that it ran that long. When the user was running it, they perceive it as slow and they are waiting on the screen to refresh. I used runAsync and what do you know – happy customer.

Show deleted items in Source Control Explorer

Common query I have seen a few times. Thought to share a simple tip. There are times when items are deleted or moved to a different model. In that case you may need to see the deleted items to roll it back or see what was deleted. In visual studio, go to the Options and tick the flag to “Show deleted items in the Source Control Explorer”. Alternatively click on this button. Thanks to Joris for pointing it out.