Tested on Project Operations on Dataverse version 4.25.0.91 (October 2021)
Approval sets are a feature that was originally introduced in PSA. The feature later graduated to Dynamics 365 Project Operations but there hasn’t been a lot of chatter about it. It kind of snuck in unannounced to help process large volumes of project approval rows. Project approvals have always been a bit sluggish with large volumes so I have high hopes approval sets will improve the reliability of project approvals.
Docs describes approval sets as follows: “Approval sets group approval requests together into smaller subsets of operations. This grouping allows approvals to be processed by project, in a specific order and allows for retrying and sequencing. Grouping the approval requests together improves the reliability and traceability of approval processing for large volumes of approvals.”
The idea of this blog post is to show how approval sets are turned on and to highlight how they perform when approving four batches of 500 time entries for four different projects. It’s a random number and might not be enough to draw definite conclusions but at least it will give an indication of how approval sets work and perform. Be sure to read the official article about approval sets on docs here.
Enabling/disabling Modern Approvals
Modern Approvals i.e. approval sets are enabled and disabled form Project Parameters. The feature control is a fairy new button in the command bar, and it’s used to control features like Modern Approvals and Subcontracting. Docs states that Modern Approvals shouldn’t be enabled or disabled when there are approvals that are being processed. I also noticed that if a 1st party solution/app is being updated from PPAC, enabling/disabling Modern Approvals produces an error.
When Modern Approvals have been turned on, the Background Approval Threshold columns appears. It’s used to define whether approvals run synchronously or asynchronously:
- When the value is set to 0, approvals are processed asynchronously.
- When the value is greater than 0, approvals are processed asynchronously when the number or rows that are being approved exceed the value set in the Background Approval Threshold column.
Once Modern Approvals are on, it’s a good idea to add the Approval Set table to the sitemap of your model-driven app, and to create detailed views for both active and inactive approval sets.
Testing approval sets
I decided to put approval sets to the test by importing a total of 2000 time entry rows for four different project into ProjOps. It’s possible to import time entries with an Entry Status of Submitted, so all I had to do was approve the time entries. Why 2k? Well more would have been tedious to approve manually and I wasn’t really interested in building automation for approvals. Import took some minutes but once it was done, I manually approved all submitted time entries.
When time entries are approved, approval set rows are created. Each row is project specific and thus only contains project approvals for the project related to the approval set. Approval sets are created whether or not the approval process runs synchronously or asynchronously. Let’s look at the different columns found on an approval set:
- Project (msdyn_project): The project an approval set is related to. Multiple approval sets can be related to a single project.
- Entry Type (msdyn_entrytype): Indicates whether the approval set is related to Time, Expense or Material.
- Action Type (msdyn_actiontype): The action that was taken with the possible options being Submit, Reject, Recall, Approve, Cancel, Unknown.
- Target Status (msdyn_targetstatus): The target status of a record based on an action taken. Options are Draft, Submitted, Approved, Rejected, Recall Requested, Unknown.
- Status Reason (statuscode): The status of an approval set. Options are Active, Queued, Processing, Partially Completed, Failed, Inactive, Completed.
- Life Time (msdyn_lifetime): Used to define the number of attempts left to process an approval set before it’s marked as failed. Changing this from 0 to a value greater than 0 for a failed approval set will re-initiate the processing of the approval set.
- System Job Id (msdyn_systemjobid): The GUID of the system job processing an approval set. Only populated when approvals are set to run asynchronously.
When an approval set is created, the related approvals can be found under the infamous Processing Approvals view. In the past, that view was a sign of problems related to project approvals but its role has now taken a turn for the better in the product. With Modern Approvals it’s normal to see approvals related to an approval set under the Processing Approvals view.
It can take a while for approval sets to move from Queued to Processing, and the system job that runs for an approval set can take some minutes to complete. In other words when approval sets are created and project approvals are processed asynchronously, you might want to get a cup of coffee or do some other tasks while you’re waiting for the system job to finish.
If an approval set fails, for example when trying to cancel approvals for already rejected time entries, the related approval rows are seen under the Processing Approvals view and the Target Status on the related approval set is Unknown. The rows under Processing Approval will stay there for a while but there’s no need for concern – they’ll disappear in the fullness of time.
Summary of findings
Here’s a short summary of my findings based on approving, rejecting, recalling and canceling approvals for four batches of 500 time entries:
- Approval sets feel like a robust feature. I tried to break it but I couldn’t. In the end, the 2000 rows I played around with didn’t result in any data loss or inconsistencies.
- Approval sets will get processed even when in doubt. If the Status Reason is Queued or Processing, just wait.
- Approvals that are being processed will be seen under the Processing Approvals view. Don’t freak out about it.
- Synchronous approvals for large batches of rows will get you stuck with the Processing, please wait… text on your screen.
- Submitting time entries for 500 rows from the UI (it’s now possible!) will also give you the Processing, please wait… text. I gave up after waiting over 5 minutes over the course of several attempts. Submitting from Excel Online is a better option.
- If an approval set has a Target Status of Unknown, you’re doing something wrong. No data will be lost but your approval set will (probably) fail.
- Active but failed approval sets can be deleted.
- Don’t try to understand the Target Entry column’s values unless your goal is to understand the TESA solution’s data model well.
- I will set the Background Approval Threshold to 0 to see if that would give the best user experience moving forward.
- With a total of 2000 approvals over several approval sets, none of the sets failed.
I hope this short post helps you understand approval sets in Modern Approvals. Be sure to leave your comments to share your experiences!