Modifying sales order line item lookup
Posted: Mon Oct 24, 2022 7:10 pm
I am trying to make a plugin which modifies how the sales order Part No lookup works. More specifically, I want to change what happens when a Part No doesn't exist.
My idea on how to do this is to find where this lookup code is running and override it.
From what I can see, the lookup is run by an event in grdLines.PartNo which triggers when focus is lost.
The problem I'm having is that grdLines.PartNo is a JiwaTextCellType and I can't see any events which do this.
This is the approach I'm currently taking
My idea on how to do this is to find where this lookup code is running and override it.
From what I can see, the lookup is run by an event in grdLines.PartNo which triggers when focus is lost.
The problem I'm having is that grdLines.PartNo is a JiwaTextCellType and I can't see any events which do this.
This is the approach I'm currently taking
- Code: Select all
public class FormPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaFormPlugin
{
public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{
if (JiwaForm is JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm)
{
var salesOrderForm = (JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm)JiwaForm;
salesOrderForm.SalesOrder.ReadEnd += delegate (object sender, EventArgs args)
{
SalesOrder_ReadEnd(salesOrderForm);
};
}
}
private void SalesOrder_ReadEnd(JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm salesOrderForm)
{
for (int row = 0; row < salesOrderForm.grdLines.ActiveSheet.RowCount; row++)
{
var cellPartNo = (JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaTextCellType)salesOrderForm.grdLines.ActiveSheet.Cells[row, 1].CellType;
//insert code changing lookup
}
}
}