The views and opinions expressed in this blog are those solely of the author(s) and do not necessarily reflect Microsoft’s current policy, position, or branding. For official announcements and guidance on Dynamics 365 apps and services, please visit the Microsoft Dynamics 365 Blog.
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, Power Apps, Power Automate, and Excel are powering major transformations around the globe. | View Gallery
2020 release wave 1 Discover the latest updates and new features to Dynamics 365 planned through September 2020
Release overview guides and videos Release Plan | Preview 2020 Release Wave 1 Timeline
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
Tested on:Dynamics 365 version 9.0
Invoice Frequencies provide a very convenient way of scheduling invoices in Dynamics 365 Project Service Automation. There is, however, very specific logic about how they work on both Time and Material and Fixed Price contract lines. While this post isn't meant to cover the different aspects of Project Contract (I covered Project Contract in a video blog), it's important to define a scenario for using Batch Jobs. In this example I'm using the following combination of Time, Expense and Fee on Time and Material and Fixed Price contract lines:
The reason I've selected this combination is based on the following details:
Analyzing the difference of the operating logic between T&M and FP contract lines reveals the need for Batch Jobs in invoicing. While FP contract lines always require an Invoice Frequency with created Periodic Milestone(s) to create an invoice, the logic of T&M contract lines differs significantly. When T&M contract Lines are used and the "Create Invoice" button is clicked on the Project Contract's ribbon, an invoice is created. This invoice pulls all approved Time and Expense Entries on the invoice despite a set Invoice Frequency, its Invoice Schedule (on T&M lines this is called Invoice Schedule as opposed to FP's Periodic Milestone) or Transaction Cut Off Dates. In other words the only way to make T&M contract lines honor Invoice Frequencies and their Invoice Schedules is by using Batch Jobs.
Batch Jobs are relative easy to set up. An important detail to remember is that the on-demand workflow "ProcessRunner" that actually creates an invoice has a condition If Batch Job:Name contains [Create Invoices]. I tried naming my Batch Job Create Invoice - without the s - and an invoice was never created.
There are a couple of important details to note when setting up Invoice Schedules (T&M lines) and Periodic Milestones (FP lines):
I have submitted and approved Time and Expense entries for various dates. As the photos in this post illustrate I have both a T&M and a FP contract line created with an Invoice Frequency set for 1st of month billing. On the T&M line the Transaction Cut Off Date is 30.11.2017 and the Invoice Run Date is 1.12.2017. This means that approved Time and Expense entries logged up to 29.11 will be included on the invoice that the Batch Job creates. For the FP contract line the first Milestone Date is 1.12.2017 so that specific Milestone will also be included on the invoice.
The following Time and Expense entries have been submitted and approved.
The next task is to run the Batch Job. As I want to run the Batch Job immediately, I'm choosing the on-demand workflow "ProcessRunner". The logic behind it is Process, Sleep, Process, Sleep vs. Sleep, Process, Sleep, Process of "ProcessRunCaller". These are the two workflows which actually create the invoices and ProcessRunner does the actual invoice creation (Microsoft, 2017).
Keep in mind that there is to be only one instance of ProcessRunner / ProcessRunCaller in the system. Multiple processes may result in duplicate invoices. Please see here for more information.
The Milestone status on the T&M line changes to Run Successful after the workflow has run. The FP line was manually set to Ready for invoicing.
The last step is to compare the Active Invoice Line Details with what was submitted and approved. All entries up to 29.11 are correctly on the invoice.
I hope this small guide enables you to take more out of invoicing in Dynamics 365 Project Service Automation. My big thanks goes to the PSA PG at Microsoft for providing additional details on creating Batch Jobs.
Disclaimer: All my blog posts reflect my personal opinions and findings unless otherwise stated.
Edits:July 3rd 2018. Added information about ProcessRunner / ProcessRunCaller with a link to another article.
Business Applications communities