Dynamics 365 Project Service Automation: Marking a Project Task as Complete to prevent Time Entries

Tested on:
Dynamics 365 version 9.0.2, PSA solution version 3.x, Unified Interface

A subject that comes up frequently is marking Project Tasks as Complete to prevent Time Entries to those tasks. As Dynamics 365 Project Service Automation doesn’t have this functionality out-of-the-box, we have to do some customizing to achieve this goal. This brief blog post will cover the basic steps to build this functionality. Note that this has been built and tested on V3 of PSA on the Unified Interface.

1. Add Project Tasks to the sitemap

The Project Task entity isn’t on the sitemap by default so it needs to be added on it. Remember to add it to the sitemap for Project Service.

2. Add an Option Set

Add an Option Set with Yes/No as options and place the field on the Project Task main form.
Edit: I received a very good suggestion from John Burrows at Microsoft about making fields required for scheduling as read only. There are sacred fields on the Project Task entity which should not be changed. Personally I would not change values in any of the OOTB fields unless there is a very good reason to do so. Tasks should primarily be edited from a Project’s Schedule (WBS) so editing Project Task records directly should in general not be necessary, unless a task is being marked as Complete.

3. Add a new view

Add a new view that has the field from step 2. Remember to add the view on the Project Service Model-driven app by using the App Designer.

4. Create a real-time workflow on Time Entry entity

A real-time workflow will prevent Time Entries for being submitted if the field created in step 2 has a value of Yes. In this example the workflow is fired off before the Entry Status field changes.

5. Test the customizations

Let’s open a Project Task and set the field created in step 2 to Yes. When Time Entries are submitted against that task, the workflow cancels our action. Journal Lines or Project Approvals are not created and the Time Entry’s Entry Status remains Draft.

I hope this brief blog post gives you an idea on how to mark Project Tasks as Complete and prevent Time Entries for those tasks.

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

 

5 thoughts on “Dynamics 365 Project Service Automation: Marking a Project Task as Complete to prevent Time Entries”

  1. Hi Anttii,

    What are your thoughts on recording the completed by/date, instead of using just a yes/no field? I’m tempted to use the actual end date but am just now testing to determine its behavior. Users would use a custom form, to fill in a completed by field, which would datestamp actual end field. The same form would allow users working from a view to also enter an actual start date and update the remaining hours.

    Also, do you know of a way to combine views to show project tasks where the the task resources include the users bookable resource OR project tasks where the task resources includes a bookable resource team including their bookable resource? I don’t believe the system supports a cross entity OR filter.

    1. Hi Ryan. I think you could use a completed by date if that would work better for you. As to the view; I must admit I’ve not tried that approach before. I’d look at View Designer and FetchXML Builder in the XrmToolBox to try it out.

  2. Hello Antti. That’s a nice idea for this customization. my team came up with an alternative approach, I thought Id share.
    OOB solution allows make a Project Task inactive (“Deactivate” button in the top ribbon when viewing a Project Task from the sitemap, as your approach suggests in step 1). We relied on this to add the following customizations:
    1. Allow to deactivate a Project Task from the Task form (similar to your suggestion), but we made the change in our custom field also trigger a task deactivation
    2. Added changed the default view used by the Project Task field Time Entry form, to allow only active Project Tasks

    This way, user simply can’t create a time entry for any task that’s supposed to be inactive.

  3. Hi Antti,

    I have a scenario to mark complete a project task.
    Let’s say we have a task with Effort as 16 hours but the project task is completed by the resource in 7 hours. So, now the resource want to mark the project task as complete to 100% but time entry should be 7 hours. How that can be achieved?
    Thanks,
    M. Fasih

Comments are closed.