PO - Form Email Before Event and Print Event

Discussions relating to plugin development, and the Jiwa API.

Re: PO - Form Email Before Event and Print Event

Postby Mike.Sheen » Tue Jun 30, 2020 12:31 pm

Riyaz wrote:I had exactly the same code as yours, but it wont work for me, if I disable mine and use yours as is, it works


It would be useful to know what was different about your plugin - it might be something we can improve to prevent problems like this in the future. Any chance you can provide a copy of your plugin (remove all the unnecessary code) which exhibits the problem?
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: PO - Form Email Before Event and Print Event

Postby Riyaz » Tue Jun 30, 2020 12:33 pm

No problems, will share that
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: PO - Form Email Before Event and Print Event

Postby Riyaz » Tue Jun 30, 2020 6:19 pm

Hi Mike

Pls find it attached, the Email button popup wont work in this but it works on the one which Stuart had sent.
Attachments
Plugin SNE- Purchase order.xml
(32.94 KiB) Downloaded 40 times
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: PO - Form Email Before Event and Print Event

Postby Mike.Sheen » Tue Jun 30, 2020 6:26 pm

Riyaz wrote:Hi Mike

Pls find it attached, the Email button popup wont work in this but it works on the one which Stuart had sent.


That works for me - I get your message box when I click the Email button on the Purchase Order form.

I get both the messagebox from the setup before method and the setup method.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: PO - Form Email Before Event and Print Event

Postby Riyaz » Tue Jun 30, 2020 6:28 pm

Thats the weirdness, it doesnt work for me. But the plugin which Stuart sent works.
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: PO - Form Email Before Event and Print Event

Postby Mike.Sheen » Tue Jun 30, 2020 6:33 pm

Riyaz wrote:Thats the weirdness, it doesnt work for me. But the plugin which Stuart sent works.


This could happen if you have another plugin you're not aware of or forgotten about that also adds a handler for the tool click in the SetupBefore method and that plugin is loaded before yours, and it throws a ClientCancelled exception.

If Stuarts one works and yours doesn't, then it might mean that alphabetically Stuart's does get executed before the one throwing the ClientCancelled is - We load plugins in order of Execution Order and then plugin name (and thus handlers are added in that order).
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: PO - Form Email Before Event and Print Event

Postby SBarnes » Tue Jun 30, 2020 6:39 pm

Hi Mike,

I am getting the same issue as Riyaz in the demo database I use, where my plugin works and his doesn't on exactly the same purchase order, order 100511.

By the way I don't have anything loaded that goes near purchase orders.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1618
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: PO - Form Email Before Event and Print Event

Postby SBarnes » Tue Jun 30, 2020 6:43 pm

Ok looks like Mike is right there is something weird going on because copying it and renaming it AAAAAAAAAAAAAAAAAAAAAAAAAAAAAASNE- Purchase order (COPY) makes it work
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1618
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: PO - Form Email Before Event and Print Event

Postby SBarnes » Tue Jun 30, 2020 6:49 pm

I think it's something in Purchase Order Custom Email plugin try disabling that as its got


Code: Select all
Private Sub UltraToolbarsManager1_ToolClick(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinToolbars.ToolClickEventArgs)
       Select Case e.Tool.Key
           Case "ID_RecordEmail"
            Dim purchaseOrderForm As JiwaFinancials.Jiwa.JiwaPurchaseOrdersUI.MainForm = DirectCast(sender, Infragistics.Win.UltraWinToolbars.UltraToolbarsManager).DockWithinContainer
            EmailPurchaseOrder(purchaseOrderForm)
            Throw New JiwaFinancials.Jiwa.JiwaApplication.Exceptions.ClientCancelledException
      End Select
   End Sub
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1618
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: PO - Form Email Before Event and Print Event

Postby Mike.Sheen » Tue Jun 30, 2020 7:25 pm

SBarnes wrote:I think it's something in Purchase Order Custom Email plugin


Yes - if that's enabled, then as it throws a ClientCancelled exception in a method acting as a handler for the ToolClick which was added in the SetupBefore phase, then any plugins with their own handler will not get that event - unless they were loaded BEFORE the Purchase Order Custom Email plugin.

Plugins are loaded in the order of Execution Order then Name - so if they all have an Execution Order of 0, plugins named alphabetically before Purchase Order Custom Email plugin will receive the event, but any after would not.

So, in Riyaz's case - the plugins would be executed in this order:

po test
Purchase Order Custom Email
SNE - Purchase Order

which explains why the plugin "po test" worked, but not "SNE - Purchase Order"
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

PreviousNext

Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 3 guests

cron