web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How can I create an invoice where case billable time is captured.

(0) ShareShare
ReportReport
Posted on by

Hi Everyone, 

I've recently been fiddling with cases in CRM. Once they're closed, I want to bill customers based on their billable time. How do I go about doing this? I can't figure out how an invoice links back to a case and how I can make billable hrs at a certain rate show up. 

Thanks in advance for for your help!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mithilesh Kumar Profile Picture
    10,047 on at

    Hi Kimberly,

    1. Create a relationship (1:N) between Case and Invoice entity.

    2. You need to create a Plugin/Custom Workflow Activity to capture the billable hours from the Case Resolution entity (every case resolution entity contains 'incidentId' of the Case record which can be used to search the record)

    3. Using the Plugin, Create the Invoice and Associate it to the Case Record

    3. Register this Plugin on the CaseClose message and Post Operation event pipeline of Incident entity

    Any clarification needed, do revert.

    Hope that helps

    Thanks

  • Community Member Profile Picture
    on at

    Thanks for the great answer. What is exactly what I have to say in the work flow? I'm very new to making workflows and a step-by-step would be so fantastic.

  • Community Member Profile Picture
    on at

    Sorry for the confusion on my question above, I was in a hurry and I didn't type it out correctly. In the second sentence, I was asking what do I need to say in the workflow.

    Thanks

  • Mithilesh Kumar Profile Picture
    10,047 on at

    Hi Kimberly,

    Do you have experience in creating Plugins?

    Thanks

  • Community Member Profile Picture
    on at

    Unfortunately, No. Could you direct me towards some information? Thanks

  • Suggested answer
    Mithilesh Kumar Profile Picture
    10,047 on at

    Hi Kimberly,

    Have a look into the SDK, it contains numerous C# Code, Plugins and Custom Workflow activities.

    The code can be found in SDK\SampleCode\CS

    Please let me know if you need any help. Feel free to revert.

    Thanks,

  • Verified answer
    Aileen Gusni Profile Picture
    44,524 on at

    Hi Kim,

    The invoice you are referring is not the Invoice Contract right?

    Check this out.

    garethtuckercrm.com/.../service-contracts-service-scheduling-in-microsoft-crm-2011

    www.magnetismsolutions.co.nz/.../Resolving_a_Case_in_Dynamics_CRM_2011.aspx

    There is always a difficulty to retrieve the billable time of the case since it will be stored in different entity, not in the Case itself, it is stored in the case resolution and also as activity in CRM with type - Case Resolution. And this entity you cannot link to Invoice (this case resolution cannot have custom relationship and will not be possible to create workflow on it)

    Yes, you will need plugin since you cannot use workflow to get the billable time. You only can trigger the workflow once Case is changed the status, but you cannot get the billable time from here, so you need workflow.

    You register your plugin once the Case is changed the status or once the IncidentResolution entity is created.

    How you create the Invoice?

    Manual or Auto?

    I'd suggest manual, because you don't want to make the users confused that the system has created an invoice everytime the Case is solved, right?

    If I were the users, I'd prefer to create a new invoice from the Case I selected by myself.

    If manual, then I would suggest you another way.

    And also Plugin cannot help you to open the newly created Invoice (which is created from the System)

    And also it makes the user confused, users have to go through one by one go to the Invoice records to continue the work.

    I'd prefer once I resolved the Case, then I go to the Invoice record under this Case and also, one Case, it is possible to create more than once Invoice, you can also split the bill or one invoice failed, then create another invoice, right?

    It is also thinking about the business functionality process, not only the technical side.

    If manual then,

    1. First, of course you need to create a relationship between Case and Invoice. From Invoice, create a lookup field or N:1 Relationship to Case

    2. Then you customize the Form of the Invoice to create a new field: Billable Time of the Case

    3. Using JavaScript, with the help of OData Query, you can retrieve the Case Billable Time through this way : You get the Lookup Id of the related Case in the Invoice Form --> Get the Case Resolution of this case --> Get the billable time from the Case Resolution.

    OData Query you can check here:

    http://missdynamicscrm.blogspot.com/2014/10/tips-and-trick-odata-crm-2011-2013.html

    So how it works in the business process.

    After the users resolve the case, then can still in the Case Form, go to the relationship explorer (in the left for CRM 2011 and there is a chevron upside on the top for CRM 2013/2015) or you can create a subgrid on this case form (to the related Invoice), then the user create a new Invoice under this case.

    That is how your script will work, to retrieve the billable time once the Invoice Form is loaded and the Invoice is linked to the Case there.

    I hope this can help you!

    Thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans