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?
Yes. There are two separate ways I can think of to do this:
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.
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 theStateCode
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.
精彩评论