by Scott.Pearce » Mon Mar 21, 2016 9:34 am
You can add references to your plugin that refer to some other plugin. This is done via the "Plugin References" tab on Plugin Maintenance. Note, however, that the referenced plugin must be namespaced.
Here's what I did:
1. I created a new plugin called "Email PO Upon Sent".
2. I modified the standard "Purchase Order Custom Email" plugin such that all the classes were wrapped in a namespace called "PurchaseOrderCustomEmail".
3. I also found that I had to change the access modifier of the "EmailPurchaseOrder" function in the "Purchase Order Custom Email" plugin from "Private" to "Public" (so that I could actually access it from the new "Email PO Upon Sent" plugin).
The "Email PO Upon Sent" essentially hooks into some business logic events and keeps track of purchase order status changes. If it finds a purchase order is being saved that has had it's status changed to "Sent", it instantiates a local copy of the "Purchase Order Custom Email" plugin "FormPlugin" class and calls it's "EmailPurchaseOrder" function.
I've attached both the modified "Purchase Order Custom Email" plugin and the new "Email PO Upon Sent" plugin for your perusal.
- Attachments
-
Plugin Email PO Upon Sent.xml
- (32.34 KiB) Downloaded 635 times
-
Plugin Purchase Order Custom Email.xml
- (30.54 KiB) Downloaded 596 times
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials