Looks like you can't get at it with the business object so the other option is to capture the user clicking on the toolbar in the form, the following is an example of how I did this in the sales order form for printing
- Code: Select all
public void SetupBeforeHandlers(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{
if (JiwaForm.GetType() == typeof(JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm))
{
JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm salesform = (JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm)JiwaForm;
salesform.UltraToolbarsManager1.ToolClick += UltraToolbarsManager1_ToolClick;
JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder salesorder = salesform.SalesOrder;
}
}
with the click being
- Code: Select all
public void UltraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
{
string key = e.Tool.Key;
if (key == "ID_RecordSalesOrderPrint")
{
}
}
The id you would be looking for in the case of save would be ID_RecordSave, given that job costing uses the maintenance form the same idea should work. Use a JiwaFinancials.Jiwa.JiwaApplication.Exceptions.ClientCancelledException to stop Jiwa saving if you find back orders.