From
- Code: Select all
JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue
how can I get the parent form and also the business logic object?
My scenario is that when a sales order custom field changes I want to wipe all the freight charges.
- Code: Select all
public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{
if (JiwaForm is JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm)
{
JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm soForm = (JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm)JiwaForm;
soForm.SalesOrder.CustomFieldValues.Changed += Attkey_CheckFreight;
}
}
public void Attkey_CheckFreight(JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue, System.ComponentModel.PropertyChangedEventArgs e)
{
if (CustomFieldValue.CustomField.PluginCustomField.Name == "FreightType" && CustomFieldValue.Contents == "2")
{
//wipe the freight
}
}
I've tried various properties in CustomFieldValue but I haven't found anything which gives me the sales order I'm editing. I'm sure there something I'm missing.