Page 1 of 1

Sales order SelectedHistoryNo and Property Changed

PostPosted: Thu Oct 06, 2016 4:08 pm
by SBarnes
Hi All,

I have been trying to detect when the choice of sales history is changed in the sales order screen from the snapshot drop down eventually, I have had to eventually add an event handler to HistoryUltraComboEditor for selection changed to get it to work.

I had previously tried tracking property change on the sale order of the form and looking for the property of "SelectedHistoryNo" changing only to discover that the sales order does not call NotifyPropertyChanged for this particular property, is there a reason why this is the case as given it is explicitly doing it I don't believe it's a bug?

Thanks.

Re: Sales order SelectedHistoryNo and Property Changed

PostPosted: Sat Nov 12, 2016 4:58 pm
by Mike.Sheen
In the NotifyPropertyChanged method of the sales order business logic we explicitly filter out changes to the SelectedHistoryNo field.

Code: Select all
Public Overrides Sub NotifyPropertyChanged(ByVal propertyName As String)
   If propertyName <> "SelectedHistoryNo" AndAlso _isClearing = False Then ' Added check for _isClearing = false for bug #10070
      MyBase.NotifyPropertyChanged(propertyName)
   End If
End Sub


But, in the setter of SelectedHistoryNo we do raise a dedicated event for the SelectedHistoryNo changing: SalesOrderSelectedHistoryNoChanged

Hook into that instead.

I don't know why we filter out the NotifyPropertyChanged for changes to SelectedHistoryNo - probably to allow some efficiency in when the form decides to redisplay the lines.

Re: Sales order SelectedHistoryNo and Property Changed  Topic is solved

PostPosted: Sat Nov 12, 2016 5:19 pm
by SBarnes
Hi Mike,

Thanks for the reply, I had gotten around this by hooking onto the events of the combo box where you select the current history.