Made a custom form with Item, Customer and Packaging Option.

I need to have a line level field in the Sales Order form called packaging option which has the given packaging option for that item and customer, how can I achieve this customization?

Made a custom form with Item, Customer and Packaging Option.
I need to have a line level field in the Sales Order form called packaging option which has the given packaging option for that item and customer, how can I achieve this customization?
Hi
protected virtual void DACName_FieldName_FieldSelecting(PXCache cache, PXFieldSelectingEventArgs e)
{
DACName row = e.Row as DACName;
List<string> ItemClassLabels = new List<string>();
List<string> ItemClassValues = new List<string>();
foreach (INItemClass item in PXSelectReadonly<INItemClass>.Select(this))
{
ItemClassValues.Add(item.ItemClassID.ToString());
ItemClassLabels.Add(item.ItemClassCD.Trim().ToString());
}
e.ReturnState = PXStringState.CreateInstance(e.ReturnState, 10, true,
typeof(DACName.FieldName).Name, false, -1, string.Empty, ItemClassValues.ToArray(), ItemClassLabels.ToArray(), false, null);
((PXStringState)e.ReturnState).MultiSelect = true;
}
If yes, please write a “InventoryID field updated” event, and based on the Inventory ID fetch the “Packaging Option” from your custom table.
Hi
Okay... I understood.
protected void SOLine_InventoryID_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
SOLine row = (SOLine)e.Row;
if (row == null) return;
PKCFPackagingOption pkgOption = PXSelect<PKCFPackagingOption,
Where<PKCFPackagingOption.item,
Equal<Required<PKCFPackagingOption.item>>>>.Select(Base, row.inventoryID);
var rowExt = PXCache<SOLine>.GetExtension<SOLineExt>(row);
if(rowExt != null ){
rowExt.usrPackagingOptionFromCF = pkgOption.packagingOption;
}
}
Attempted this approach, what are the corrections to be done?
Hi
Are you getting the values in pkgOption object?
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.