Detect Custom Field change

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

Detect Custom Field change

Postby SBarnes » Wed Sep 09, 2026 11:35 am

How can you detect the change to a custom field on the sales order history I have tried adding the following code to the red end of the sales order but the event doesn't fire

Code: Select all
var history = salesOrder.SalesOrderHistorys[salesOrder.CurrentHistoryNo];
history.CustomSettingValues.get_ItemFromSettingName("NoPallets").PropertyChanged += DetrackWorker_PropertyChanged;
history.CustomSettingValues.get_ItemFromSettingName("CollPallets").PropertyChanged += DetrackWorker_PropertyChanged;

private void DetrackWorker_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
    if (e.PropertyName.ToUpper() == "CONTENTS")
    {
        salesOrder.GenericObjectCollection.SetOrAdd<bool>("PalletsChanged", true);
    }
}
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1718
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 194

Re: Detect Custom Field change

Postby perry » Fri Sep 11, 2026 10:56 pm

I'm tracking all custom fields instead of individual ones.

Code: Select all
                 
AddHandler so.SalesOrderHistoryCustomSettingValueChanged, AddressOf SalesOrderHistoryCustomSettingValueChanged
OR
AddHandler so.SalesOrderHistorys(so.CurrentHistoryNo).CustomSettingValues.Changed, AddressOf SalesOrderHistoryCustomSettingValueChanged
Perry Ma
S. Programmer
Lonicera Pty Ltd
http://www.lonicera.com.au
perry
Frequent Contributor
Frequent Contributor
 
Posts: 177
Joined: Mon Oct 27, 2008 2:26 pm
Topics Solved: 17


Return to Technical and or Programming

Who is online

Users browsing this forum: Baidu [Spider] and 92 guests