I have added a field to the Transfers screen in the summary section. This is a database field as below:
The intention is that this will be set to the default location which will be used by newly created entries in the grid below using fielddefaulting to set the value of location from this field.
I have a couple of questions.
- How do I access this field’s value from the fielddefaulting event for Location?
I have previously accessed an extension to get a user field (SOOrderExt in that case) using:
SOOrderExt sOOrderExt = PXCache<SOOrder>.GetExtension<SOOrderExt>(row);
Using the same method to try to access the extension from INRegisterExt:
protected void INTran_LocationID_FieldDefaulting(PXCache cache, PXFieldDefaultingEventArgs e, PXFieldDefaulting InvokeBaseHandler)
{
if(InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
var row = (INTran)e.Row;
if (row == null) return;
INRegisterExt iNRegisterExt = PXCache<INRegister>.GetExtension<INRegisterExt>(row);
e.NewValue = iNRegisterExt.UsrDefaultLocation;
}
gives error:
An object reference is required for the non-static field, method, or property 'PXCache<INRegister>.GetExtension<INRegisterExt>(object)'
- How do I add a selector to the field in Summary to choose a location from the list in INLocation for the MAIN warehouse?
Any help would be much appreciated.
Phil