Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crm dynamics custom action after clicking Invoice Paid

In MS CRM When user clicks Invoice Paid, I need to notify external site that this invoice was paid Is this possible to achieve this?

like image 616
Zlobaton Avatar asked Sep 22 '11 12:09

Zlobaton


People also ask

How do I create a custom action in Dynamics CRM?

Activated custom actions are available to processes by selecting the Perform Action item in the Add Step drop down of the web application process form. After the step is added to your process, you can select your new custom action (or any action) from the Action list provided in the step.

Can Dynamics 365 Action call another action?

You can call actions: From code that executes within a plug-in or custom workflow. From a command that is placed in the application and executes the operation using JavaScript code. From an integration with another system that uses the Dynamics 365 Customer Engagement (on-premises) web services.

What happens when you create an order from a quote record d365?

The process of converting a quote to an order is straightforward in Dynamics 365 for Sales. By clicking the create order button on the command bar, an order is created, and the contents of the quote are added to the order record. It is important to note that after a quote is accepted, you won't be able to revise it.


1 Answers

Yes. There are two separate ways I can think of to do this:

  1. Hide and recreate the Invoice Paid button via the CRM's RibbonXML and use your own javascript methods to change the status of the invoice to "Paid" and also talk to the external site. This would work so long as the only way the Invoice's status is changed to Paid is via the Invoice Paid button.

  2. When you click the invoice paid, the value of the StateCode property of the Invoice changes to "Paid", which is a value of 2. So, you can also register a plugin that fires on the Update message of the Invoice and check the before and after properties of the entity to see if the StateCode was not equal to "Paid" in the Pre Image and equal to "Paid" in the Post Image. This would be a server-side solution and would work no matter how the Invoice Paid action was triggered, and also gives you access to the .NET framework.

like image 109
Peter Majeed Avatar answered Sep 24 '22 23:09

Peter Majeed