Sales Order popup  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Sales Order popup

Postby Atronics » Fri Feb 12, 2016 3:11 pm

I want to have a message popup when specific debtors are selected in the sales order form. The following code gets the popup to work on saving the sales order
Private Sub SalesOrderSaveEnd(ByVal sender As Object,ByVal e As System.EventArgs)
How do I get to to work, once the debtor is selected?
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10

Re: Sales Order popup  Topic is solved

Postby Mike.Sheen » Fri Feb 12, 2016 7:29 pm

Atronics wrote:I want to have a message popup when specific debtors are selected in the sales order form. The following code gets the popup to work on saving the sales order
Private Sub SalesOrderSaveEnd(ByVal sender As Object,ByVal e As System.EventArgs)
How do I get to to work, once the debtor is selected?


Add a handler to the CreateEnd event and examine the Debtor property of the sales order - i.e.:

Code: Select all
    Public Sub Setup(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.Setup
      Dim salesOrderForm As JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm = DirectCast(JiwaForm, JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm)
      AddHandler salesOrderForm.SalesOrder.CreateEnd, AddressOf SalesOrder_CreateEnd
    End Sub
   
   Public Sub SalesOrder_CreateEnd(sender As Object, e As System.EventArgs)
      Dim salesOrder As JiwaSales.SalesOrder.SalesOrder = DirectCast(sender, JiwaSales.SalesOrder.SalesOrder)
      
      If salesOrder.Debtor.AccountNo = "1001" Then
         MessageBox.Show("Debtor is 1001")
      End If
   End Sub


Attached is a VB.NET plugin which does this.
Attachments
Plugin MessageBox When Debtor Selected.xml
(31.21 KiB) Downloaded 739 times
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: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Sales Order popup

Postby Atronics » Mon Feb 15, 2016 10:17 am

Thanks, Mike. That does the job perfectly and gives me the framework for other similar requirements.
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10

Re: Sales Order popup

Postby Mike.Sheen » Fri Feb 19, 2016 10:28 pm

Atronics wrote:Thanks, Mike. That does the job perfectly and gives me the framework for other similar requirements.


Great! Note that an alternative to message boxes is the desktop alert - A sample of this is here. Where appropriate, they may be a better alternative to message boxes.
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: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 1 guest