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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Custom "Create Invoice" Functionality

(0) ShareShare
ReportReport
Posted on by

I currently have some custom columns for line items in my order entity (salesorder/salesorderdetail) as you can see in the photo below.

Screen-Shot-2017_2D00_08_2D00_09-at-1.55.33-PM.png

However, whenever click the "Create Invoice" button, these columns are not brought over to the actual invoice, as seen below.

For example, the Vendor column is empty.

Screen-Shot-2017_2D00_08_2D00_09-at-1.55.49-PM.png

Is there any way I can make it so that these custom column values are brought over into the invoice as well? As far as I know, Invoice Products are not editable via workflows.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    You might be able to create a workflow that on the create of a record, will retrieve the associated records from the SalesOrderDetail entity.  If that is not possible, you can override the logic of the existing Create Invoice with your own.

    Basically create a new Create Invoice button (Ribbon Workbench), hide the existing Create Invoice button and execute an Action on Click that will take the Sales Order/Sales Order Details and replicate them into Invoice.

    There might be another solution that I am unaware of as it related to Sales Order and Invoices, but I think these are your options.

  • Community Member Profile Picture
    on at

    I have tried creating a workflow but I do not believe that workflows are supported for SalesOrderDetail and InvoiceDetail entities.

    I have identified the function that is called when the "Create Invoice" button is created, but I do not know where I can find this file. I believe that this is for an on-premise instance. Our system is online.

    /_static/sfa/salesorder/salesorder.js

    Without a way to find the salesorder.js file, I do not know how I would create my own function and have it execute it in a similar way as the old button.

    Any suggestions?

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Got it.

    First of all, you are not allowing to make any changes to out of the box script file (as the one mentioned above). Even if you were On-Prem, that would make your system unsupportable, and MS would not provide you support if any issue arises.

    Since you are using CRM Online, you don't really have that issue.

    The InvoiceDetail (Invoice Product) does not have any relationship with the SalesOrderDetail (Sales Product), but does have a relationship with the Product entity, so you might be able to get the Retail Price and Unit from there. Not sure regarding Vendor.

    You need to find a field that can match between these two records.

    If you can find that field, then you can create a plugin on your Create Message for the Invoice Detail that would retrieve those fields. The Invoice does has a record for the Sales Order, so maybe that is one way to find the related records.

    Not sure if there is another way.

  • Suggested answer
    Brad.Klein Profile Picture
    on at

    Not sure what version of CRM you are using, but CRM 2015 had relationships between quote product, sales order product, and invoice product they just couldn't be navigated to from the UI. You can use the mappings on these relationships to copy data between the entities just like any other relationship in CRM. See this article for details.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans