Detect Custom Field change
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);
}
}