Supressing message when credit limit exceeded  Topic is solved

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

Supressing message when credit limit exceeded

Postby DannyC » Mon Sep 28, 2015 3:02 pm

In Jiwa 6.5.13, there was a rtnSuppressMessages when in the SalesOrderCreditLimitExceeded breakout.
Setting it to rtnSupressMessages = True would prevent Jiwa from displaying the default message when a debtor was beyond their credit limit.

How can we do the same in a Jiwa 7 plugin?
Basically, although the debtor has a credit limit I don't need Jiwa to check for it. I plan on doing my own credit check on the salesOrderForm.SalesOrder.SaveEnding event.

Cheers

Danny
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Supressing message when credit limit exceeded  Topic is solved

Postby Scott.Pearce » Tue Oct 20, 2015 1:57 pm

Create a plugin for the sales order form.

In FormPlugin.Setup, remove the handler for the SalesOrderCreditLimitExceeded event:

Code: Select all
RemoveHandler _SalesOrder.SalesOrderCreditLimitExceeded, AddressOf _SalesOrder_SalesOrderCreditLimitExceeded


No more message.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: Supressing message when credit limit exceeded

Postby Mike.Sheen » Tue Oct 20, 2015 6:52 pm

Scott.Pearce wrote:Create a plugin for the sales order form.

In FormPlugin.Setup, remove the handler for the SalesOrderCreditLimitExceeded event:

Code: Select all
AddHandler _SalesOrder.SalesOrderCreditLimitExceeded, AddressOf _SalesOrder_SalesOrderCreditLimitExceeded


No more message.


That's actually adding a handler. I think you meant something like this:

Code: Select all
Dim salesOrderForm As JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm = DirectCast(JiwaForm, JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm)
RemoveHandler salesOrderForm.SalesOrder.SalesOrderCreditLimitExceeded, AddressOf salesOrderForm._SalesOrder_SalesOrderCreditLimitExceeded


To give some context - in the sales order form, we do this in the AddHandlers method:

Code: Select all
AddHandler _SalesOrder.SalesOrderCreditLimitExceeded, AddressOf _SalesOrder_SalesOrderCreditLimitExceeded


and the method looks like this:

Code: Select all
Public Sub _SalesOrder_SalesOrderCreditLimitExceeded(sender As Object, e As System.EventArgs)
    If MsgBox("Debtor has exceeded their credit limit." & vbCrLf & vbCrLf & "Are you sure you wish to save ?", vbQuestion + vbYesNo, "Credit Limit Exceeded.") = vbNo Then
        Throw New JiwaApplication.Exceptions.ClientCancelledException
    End If
End Sub


So the plugin you need should remove the handler added.
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: Supressing message when credit limit exceeded

Postby Scott.Pearce » Wed Oct 21, 2015 8:16 am

Thanks. I meant RemoveHandler. I'll update my post.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 2 guests