Page 1 of 1

Business logic wont fire

PostPosted: Mon Sep 12, 2016 2:06 pm
by Riyaz
Hi there

We are building up a plugin which creates a CSV export, its written inside the Business logic section and is supposed to trigger on sales order processed, but it wont, also tried having a message box in it. Kindly advise on what am doing wrong here. Have attached the plugin

Re: Business logic wont fire  Topic is solved

PostPosted: Mon Sep 12, 2016 7:50 pm
by Mike.Sheen
Hi Riyaz,

You can simply add the business logic to the tab of the plugin (add "Sales Order Entry"), then your plugin will work.

However, as you're wanting to show a dialog, you shouldn't be using the BusinessLogicPlugin class to hook the business logic - it might be invoked from a service, so you don't want to ask for user interaction.

Instead, add your handler in the Setup method of the FormPlugin class - it'll invoke when the sales order is processed, but only from the sales order form - not another invocation such as a service. Attached is a modified version of your plugin showing this.

Mike