Dynamics 365 Project Service Automation: Helpful Time Entry and Project Approval views

Tested on:
Dynamics 365 PSA version 3.10.9.21

Time Entry and Project Approval entities usually need to be complemented with custom views in D365 PSA projects. This blog post has examples of some common requirements for custom views. Before we jump into the examples, it’s good to remind ourselves of a couple of points on how PSA behaves:

  • When a Project Team Member is set as a Project Approver, the PTM will become the project’s Project Approver for Time Entries and Expenses. A project can have several Project Approvers.
  • Delegated Time Entries are not supported in PSA V3. To submit a Time Entry on a Bookable Resource’s behalf, make the field msdyn_bookableresource (Bookable Resource) visible on the Time Entry entity’s quick create form and populate the lookup with the Bookable Resource on whose behalf Time Entries are submitted. Remember that the owner of the Time Entry record will be the user creating the record. If the Bookable Resource, on whose behalf the record is being created, should own the record, create a workflow that assigns the created record to the Bookable Resource.
  • Consider if custom views should be public views or shared personal views. This ties to how security roles have been set up and is a discussion of “who can see what” in PSA.
  • The Time Entry entity has the Time Entry Grid enabled for it. The grid will show on all views – OOTB and custom. This isn’t optimal if a list view is preferred. The grid can be disabled from being an entity-level control and then enabled individually for different public views. Remember to write down the values used on the grid!
  • Remember to add new public views to your Model-driven app.
Time Entry Grid enabled on the Time Entry entity.
Adding the Time Entry Grid to a view. At the time of writing this blog post, PFC controls need to be added from the classic solution explorer.

Views for Time Entries

Let’s look at some example views for Time Entries. Consider whether these views should be private or public if you implement them.

All Draft and Returned Time Entries

This view shows all Time Entries with an Entry Status of Draft and Returned. Note that the Time Entry Grid PCF control has not been applied to this view to make it easier to filter the results. An additional filter for Organizational Unit could be added to filter results based on an org unit.

Approved/Submitted Time Entries From Last 2 Weeks

This view shows all Time Entries with an Entry Status of Approved/Submitted from the past 14 days. Note that the Time Entry Grid PCF control has not been applied to this view to make it easier to filter the results.

Views for Project Approvals

The Project Approval entity only has list views without a PCF grid. Let’s look at different approval view examples. If you’re creating a new view as a copy of the OOTB Time Entries for Approval view, you’ll run into an error editing the view’s query. More on this in a few chapters below.

All Submitted and Pending/All Approved Time Entries for Approval

As the OOTB views only show Time Entries where a user is set as a Project Approver, a quite frequent ask is to see all approvals in PSA. This view shows all submitted and pending / all approved Time Entries in PSA, depending on the value in the Record Stage field. Add the Date field to the query if you want to filter the results, for example for the past 14 days. Consider whether this should be a public or a personal view and what access level to the Project Approval entity’s read privilege a user should have.

Approval by Organizational Unit

Filtering approvals by a submitter’s and approver’s Organizational Unit is a common requirement. If a project has Project Team Members from different org units, companies might want approvers to only see and approve time and expense for Bookable Resources in the same org unit as an approver.

The OOTB Time Entries for Approval is a good start for a custom view of this kind but there’s a catch to creating such a view. If we look at the OOTB Time Entries for Approval view with Advanced Find, we can see that there is something going on with the view. While it seems like the view is broken, it’s actually working just fine. Advanced Find can’t properly display the msdyn_projectteam link entity and the condition related to it. The view is also missing a value for msdyn_projectapprover (Project Approver) and this prevents us from saving any edits to the view’s query. Set the field’s value to Yes to save any changes made to the query.

Time Entries for Approval view in Advanced Find.
FetchXML for Time Entries for Approval with msdyn_projectteam link entity.

To filter results based on a submitter’s and approver’s org unit, the following changes to the view are needed:

Complex queries

Sometimes the OOTB query builder isn’t enough. FetchXML can be used to build complex views, beyond the OOTB query builder’s capabilities. To build complex views with FetchXML, you can use two easy tools in XrmToolBox: View Designer and FetchXML Builder. Open your new view in View Designer and then hop over to FetchXML Builder by clicking on Edit Query.

View Designer.

All the magic is done in FetchXML Builder and a custom query is added to its Query Builder. Below is an example of an approval view’s FetchXML that filters a submitter’s Organizational Unit by London Org Unit.

<link-entity name="bookableresource" from="bookableresourceid" to="msdyn_submittedby" alias="submitter" >
      <link-entity name="msdyn_organizationalunit" from="msdyn_organizationalunitid" to="msdyn_organizationalunit" link-type="inner" alias="orgunit" >
        <filter type="and" >
          <condition attribute="msdyn_name" operator="eq" value="London Org Unit" />
        </filter>
      </link-entity>
    </link-entity>
FetchXML Builder and its Query Builder with the added FetchXML.

After the view has been built, results can be viewed in the View Designer by clicking on Live Preview.

Disclaimer:
All my blog posts reflect my personal opinions and findings unless otherwise stated.

Leave a Reply

Your email address will not be published. Required fields are marked *