Client wants the SOH transaction Detail to always sort with most recent on top.
What would I need in a plugin to have it sorted by DateIn descending?
Cheers


SBarnes wrote:If I am understanding you request correctly you don't need a plugin.
In the system settings under inventory there is a setting called StoredProcForInventoryTransactionHistoryGrid this points to a stored procedure that works like custom form tabs do, i.e. two datasets returned one for the schema and one for the data.
Just copy the procedure to one with a different name add your order by clause, and repoint the setting to your new procedure.

in Demo Data there is a plugin - Sort Notes - which changes the sort order of the notes grids

#region "FormPlugin"
public class FormPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaFormPlugin
{
public override object InitializeLifetimeService()
{
// returning null here will prevent the lease manager
// from deleting the Object.
return null;
}
public void SetupBeforeHandlers(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{
}
public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{
if (JiwaForm is JiwaFinancials.Jiwa.JiwaInventoryUI.InventoryMaintenanceForm)
{
JiwaFinancials.Jiwa.JiwaInventoryUI.InventoryMaintenanceForm InventoryMainForm = (JiwaFinancials.Jiwa.JiwaInventoryUI.InventoryMaintenanceForm)JiwaForm;
InventoryMainForm.Inventory.ReadEnd += Inventory_SortSOH;
}
}
private void Inventory_SortSOH(object sender, System.EventArgs e)
{
JiwaFinancials.Jiwa.JiwaInventory.Inventory inventory = (JiwaFinancials.Jiwa.JiwaInventory.Inventory)sender;
JiwaFinancials.Jiwa.JiwaInventoryUI.InventoryMaintenanceForm InventoryMainForm = (JiwaFinancials.Jiwa.JiwaInventoryUI.InventoryMaintenanceForm)inventory.Client;
//System.Diagnostics.Debugger.Launch();
JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid SOHGrid = (JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid)(null);
SOHGrid = InventoryMainForm.grdSOH;
SOHGrid.ActiveSheet.Columns["DateIn"].ShowSortIndicator = true;
SOHGrid.ActiveSheet.SortRows(SOHGrid.ActiveSheet.Columns["DateIn"].Index, false, true);
}
}
#endregion
DannyC wrote:Something isn't right because the grid remains sorted by ascending DateIn.

Return to Technical and or Programming
Users browsing this forum: No registered users and 2 guests