Dynamics 365 Project Service Automation: Setting Products and Milestones as “Ready to Invoice” when a Project Task is “Complete”

Tested on:
Dynamics 365 CE version 9.1, PSA solution version 3.6, Unified Interface

I was talking to my friend MVP Scott LeFante about products and tasks in Dynamics 365 Project Service Automation after our PSA focused At Your Service episode. Scott and I were thinking about ways of invoicing Product-based lines and Milestones when a Project Task is complete. I naturally wanted to try that with Flow. Let’s get started.


Before our Flow can be built, a custom field is needed on both the Project Task entity and the Order Line entity. For Project Task we need a Yes/No option set that will be used to indicate if a task is complete or not. For Order Line a lookup field to Project Task is needed. This way we know which Product-based line is related to which Project Task.

Project Task and Order Line for Product-based lines

Building the Flow

The Flow sets Product-based lines and Milestones as either ready for invoicing or not ready for invoicing, when a Project Task is set to “Complete”. In PSA, the values and names of fields relating to billing statuses vary depending on the entity. The table below illustrates the differences.

Order LineProject Contract
Line Milestone
Logical namemsdyn_billingstatusmsdyn_invoicestatus
Display nameBilling StatusInvoice Status
Value for not
ready to invoice
Null / empty option
set value
192350000 / Not Ready
for invoicing
Value for ready
to invoice
192350004 / Ready to
192350001 / Ready for

I wanted to run both Product-based lines and Milestones in their own scopes and as parallel branches, so I decided to add a push notification action just before the scopes. A project manager will be the most likely person editing values on Project Tasks so a notification about possible ramifications to invoicing could be found valuable.

Push notification

The Flow itself is very simple. It is fired off when a value on the Task complete? field changes. A push notification is sent and Product-based lines (Order Line entity) and Milestones (Project Contract Line Milestone entity) are then edited based on the value on the Task complete? field.

The Flow

This brief blog post shows how we can leverage Flow to extend PSA in ways that would normally require code. We’re also able to tackle a frequent business requirement of associating products to Project Tasks to then invoice them when a task is complete. I hope this post gives you ideas about the various, rich possibilities around extending the Power Platform and the 1st party applications with Flow.

As always, this Flow can be downloaded from the TDG Power Platform Bank here.

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

1 thought on “Dynamics 365 Project Service Automation: Setting Products and Milestones as “Ready to Invoice” when a Project Task is “Complete””

  1. This is something superb. I’m proud to be part of Dynamics World & genius like you making smoother to learn. Thanks a ton.

Comments are closed.