public virtual int? UsrKitQtyAvail{ get; set; } public abstract class usrKitQtyAvail: PX.Data.BQL.BqlInt.Field<usrKitQtyAvail> { } #endregion } }
Page 1 / 1
Update: Have fixed this by removing the current. However now field does not update when i change the warehouse location?
I could be wrong in how I’m approaching these fields but I find that I have to force the calculation on PXDBScalar when fields that the calculation depends on change. My this I mean that in addition to the PXDBScalar attribute that I would, in your case, add an override to the existing SOLine_SiteID_FieldUpdated event to lookup the value and populate your UsrKitQtyAvail field.
Generally, once the record is saved then the calculation does what I want it to do, but before that point, I have to duplicate the lookup when fields that are part of the calculation changes.
//Get the KitAssy record AutoKitAssembly.KitAssy kitAssy = PXSelect<AutoKitAssembly.KitAssy, Where<AutoKitAssembly.KitAssy.builtItemID, Equal<Required<AutoKitAssembly.KitAssy.builtItemID>>, And<AutoKitAssembly.KitAssy.siteId, Equal<Required<AutoKitAssembly.KitAssy.siteId>>>>> .Select(InventoryID_FieldUpdated, SOLine.InventoryID, SOLine.SiteID);
if (kitAssy != null) { soLineExt.UsrKitQtyAvail = kitAssy.QtyAvail; }
} } }
Update. I can get this code to assemble however it doesnt seem to update the row correctly. each time i change the site or inventory it just goes to zero? Loading a item however still works..
Hi aaghaei, yep I did this already could you check my post just above?
Yeah I noticed they are posted at the same time
Is CommitChange for the field is set to True in your page?
Yes CommitChange for both fields (InventoryID and SiteID are true). I almost have it working. When I change the inventoryID the scalar field recalculates each time all good! However when I change the Warehouse location it changes only once and then never again? If I scroll to the next record then back it shows the correct quantity?
That worked perfectly thanks so very much Ive been working on this all day!!!!
I have 2 other tasks to do which could you point me in the right direction:
I want to add a new grid tab called “Kit Detail” to show the kit components of the row selected in the detail tab.
I need a dropbox box/selector user input field (Auto Build Amount) which allows the user to select a integer (0,1,2,3...) but only up to the Qty on the sales order line. It should update the combobox/selector if the quantity is changed too?
Hi @Dantheman88988 Please find the details below hope that helps!
I want to add a new grid tab called “Kit Detail” to show the kit components of the row selected in the detail tab.
oNaveen] Create a new grid and add a Master-Detail relation with SOLine grid (Master) and your grid (Detail grid) so that based on the selected KIT item, it will show its components in the new grid.
I need a dropbox box/selector user input field (Auto Build Amount) which allows the user to select a integer (0,1,2,3...) but only up to the Qty on the sales order line. It should update the combobox/selector if the quantity is changed too?
/Naveen] Since you wanted to build the Amount automatically, you can write a field updated events for Qty and UnitPrice fields, so that when you change these fields, accordingly will update the new field with the amount value.