Dynamics CRM Sales Invoices are the last stage of the sales cycle. Dynamics CRM Sales Invoices are made after an order has been fulfilled. Microsoft Dynamics 365 for CRM is not intended to be a complete financial management system. If Invoices are being used in Dynamics CRM and is typically integrated with a financial management or ERP system.
Use Plugin in Dynamics CRM Sales
Here are the steps:
- Download the CRM SDK from Microsoft.
- In SDK package, include the “CRM SDK Templates” into Visual Studio.
- Create a new Dynamics CRM Plug-in Library in Visual Studio.
- Create an fresh bound entity classes with the code generation tool.
- Use the early bound entity classes to retrieve the Dynamics CRM Sales Invoice entity from the Local Plugin Context.
Use and create Web API in D365 for Financials
Presently you have your Sales Invoice entity from Customer Relationship Management and want to map the related fields in Financials and send those field values to Financials.
- Start creating a Web Service for Sales Invoices in Financials. Make a duplicate copy of the Web Service URL and you will require it.
- Discover the metadata (data structure formatted in JSON) of the Web Service you just created. You can create a temporary Console Application and add the service reference. Then you can check the data type of the sales invoice in Visual Studio.
- Decide and map the related fields. Create your own class with the similar fields in the Plugin code.
- Use Data Contract Json Serializer to serialize your created class for sending it to the web service.
- Create a web request to the URL of the Web Service using HTTP Client class (username is your account user name in Financials and the password is your web service key).
- Send the request to the Web Service by using POST method.
- Then you want to send the Sales Invoice line items. You are going to repeat Steps 2 to 6 for the line items: creating a line item class, mapping the fields, serializing it and posting it. The one and only tricky point is the line item URL is based on the header you previously sent.
What’s more tricky is that occasionally the header passed into Financials successfully but the line or lines do not. At that point you need to log into Financials and delete the header manually.
We at Locus IT are passionate about offering responsive support for Microsoft Dynamics. Locus IT is a Microsoft Dynamics CRM partner, our support staff provides on-demand technical help with routine maintenance, technical issues, and Dynamics additions and changes.