Tested on: PSA version 220.127.116.11
Project resources occasionally make mistakes with time entries and want to recall them. If a time entry has already been approved, a user recalling them is given an option to type a reason for their recall request. One might think a project approver will then get a notification with comments about the request. In reality, a recall request is only seen on the Recall Requests for Approval view on the Project Approval entity. If an approver wants to see the comments related to the recall request, the comments can only be found on the timeline of the original time entry.
Let’s consider the following example use case and then see what we can do to make all of this a bit easier: As a project approver I want to be timely notified of comments in time entry recall requests so that our organization can quickly move through the time entry to approval process and mitigate bottlenecks in it.
I think it’s safe to argue our example is very universal. Organizations don’t want time entry recall processes to have bottlenecks that delay the process and project invoicing. Regardless of their size, companies may have significant amounts of revenue in limbo if a recall process such as the one we’re covering on this blog post doesn’t work efficiently.
Power Automate can help streamline time entry recalls so that project approvers are notified of recall request comments. There are several ways the example requirement can be approached: Notify approvers of all recall requests, notify approvers of recall requests with comments, send an email to project approvers, post recall requests to a Teams channel with a mention, and so on. For this example, we’re focusing on recall requests with comments by sending project approvers an email.
Before we just to the Flow, it’s important to understand that notifications to project approvers could be sent in different ways. While this example sends an email to all project approvers of a project, an alternative approach could be to only notify the original project approver of the time entry (the owner of a project approval record) and disregard any other approvers set on a project team. Next, let’s dive into the Flow that sends time entry recall requst comments to a project’s project approvers.
1. Trigger and initial actions
The Flow fires off when a new Note related to Time Entry (msdyn_timeentry) is created. Notes are automatically created when recall request comments or recall request rejection comments are given. The scope action includes composes that make it easier to reuse information in the later stages of the Flow. The last two get actions are used to access the time entry record that is related to the recall request, recall request rejection comments, and the project related to the time entry.
2. Rejected recall request
After the initial actions we need to evaluate whether a time entry record has an entry status of Returned, Recall Requested or Approved. The first condition will evaluate whether entry status is Returned or Recall Requested. If the condition returns a false, the following condition evaluates whether the record’s entry status is Approved. None of the other statuses are valid for our use case so if entry status is something else than Approved in the second condition, the Flow will terminate as canceled.
A time entry will have an entry status of Approved when a project approver rejects a recall request. The comments given for the rejection end up on the original time entry record and the idea of the following actions is to inform the original requestor of a rejected recall. You could also extend the Flow to send a notification to all project approvers of the related project.
3. Approved recall request
If a project approver approves a recall request, a notification about the approved recall is sent to all project approves on the related project. As I mentioned earlier, you can change the Flow to only notify the original approver and to also send a notification to the requestor. There are lots of options depending on your exact use case.
Before a notification is sent to all project approvers on the related project, some FetchXML is needed. We need to loop through the project’s Project Team Members to list all project approvers on the related project. If anyone, despite their role, can be an approver, a simple Filter Query is enough. If you want to limit the results to approvers who have the role of Project Manager, FetchXML is needed. Again, there are several ways to approach this scenario, depending on your exact use case. The FetchXML I’ve built with FetchXML Builder is as follows:
<fetch> <entity name="msdyn_projectteam" > <filter> <condition attribute="msdyn_projectapprover" operator="eq" value="1" /> </filter> <link-entity name="bookableresourcecategory" from="bookableresourcecategoryid" to="msdyn_resourcecategory" > <filter> <condition attribute="name" operator="eq" value="Project Manager" /> </filter> </link-entity> <link-entity name="msdyn_project" from="msdyn_projectid" to="msdyn_project" > <filter> <condition attribute="msdyn_projectid" operator="eq" value="ProjectGuidHere" /> </filter> </link-entity> </entity> </fetch>
A Filter Query for a more straightforward approach would be:
_msdyn_project_value eq GuidHere and msdyn_projectapprover eq true
An apply to each naturally follows a list records action. From this point on the rest of the Flow is pretty straightforward. We need to get our hands on the Bookable Resource Record for the Project Team Member we’re looping through. Based on that we can get our hands on the D365 user record and then the UPN, so that we can send the project approver in question an email.
A switch is used to evaluate what the entry status of a time Entry record is. Based on a selected route, an email will be sent to all project approvers of a project. Possible values are:
- Recall Request. A recall request for a Time Entry record has been made by the submitter.
- Returned. A project approver has approved a submitter’s recall request and a Time Entry has been returned to the submitter.
- Approved. A recall request has been rejected and the related Time Entry remains approved.
When the Flow has run, a project approver will get an email that points to the Time Entry a requestor has requested a recall for.