Get FieldName of changed property  Topic is solved

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

Get FieldName of changed property

Postby DannyC » Mon Aug 03, 2015 6:42 pm

Hi,

Back in 6.5.13, on a module in the Changed breakout event, we were passed the FieldName.
In Jiwa 7, how can we get the fieldname when PropertyChanged fires a sub?

For example, if I wanted to write some code when the Debtor, On Hold tickbox has been ticked or unticked, how can I check that it was the AccountOnHold field which was edited?
Code: Select all
    Public Sub Setup(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.Setup
      Dim DebtorForm As JiwaDebtorsUI.frmDebtor = DirectCast(JiwaForm, JiwaDebtorsUI.frmDebtor)
      AddHandler DebtorForm.Debtor.PropertyChanged, AddressOf Debtor_Changed   
   End Sub
   
   Sub Debtor_Changed(Sender As Object, e As System.EventArgs)
      Dim Debtor As JiwaDebtors.Debtor  = DirectCast(sender, JiwaDebtors.Debtor)   
      msgbox(Debtor.AccountNo)
   End Sub


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

Re: Get FieldName of changed property

Postby indikad » Thu Aug 06, 2015 12:33 pm

I too need some help here too .

My requirement is in "SalesOrderLineChanged" event

I have a 6.5.13 code that needs conversion ( has some code that has filtering logic by the FieldName ).
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2

Re: Get FieldName of changed property  Topic is solved

Postby Mike.Sheen » Tue Aug 18, 2015 4:27 pm

The Changed events we have pass a parameter of type System.ComponentModel.PropertyChangedEventArgs.

eg:

Code: Select all
Sub Debtor_PropertyChanged(Sender As Object, e As System.ComponentModel.PropertyChangedEventArgs)


Danny's example is wrong - I don't know how he arrived at his example, but it's not right so ignore it.

So, e in this example has some properties - examine them and you will find one named "PropertyName". This is the name of the property which changed causing the PropertyChanged event from firing.
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 0 guests