I created string type attribute and used on Purchase Orders screen.
AttributesUDF Fields on Purchase Orders Screen
Requirement: I want to display this on Bills and Adjustment screen.
A.) Able to do: We can easily add on ADD PO popup.
B.) Query: But not able to find any way to display on ADD PO LINE popup or on Details Grid
ADD PO | ADD PO LINE | DETAILS grid
Fyi, On Details screen PO Number field is present.
PO Number is Present on Bills and Adjustment details grid.
Requirement is very simple. UDF fields on POOrder should be displayed on various other place.
Best answer by darylbowman
...sometimes we need to extend existing development. UDF already present.
We’ve all been there.
Try something like this in your FieldSelecting event for the APTran extension field:
protected virtual void _(Events.FieldSelecting<APTranExt.usrProNbr> e) { APTran row = e.Row; if (row is null) return;
var purchaseGraph = PXGraph.CreateInstance<PurchaseOrderEntry>(); POOrder order = purchaseGraph.Document.Search<POOrder.orderNbr>(row.PONbr, row.POOrderType);
var udfValue = purchaseGraph.Document.Cache.GetValueExt(order, "AttributePRONBR") as PXStringState;
The Detail lines of the Bills and Adjustments screen are from the APTran DAC:
You would need to extend this DAC and add an unbound field. You could use a FieldSelecting event handler to lookup the value from the PONbr in that line.
Rather than using attributes, I would suggest going all in on custom fields and adding a bound field to POOrder. This will serve you better and with less complications.
The Detail lines of the Bills and Adjustments screen are from the APTran DAC:
You would need to extend this DAC and add an unbound field. You could use a FieldSelecting event handler to lookup the value from the PONbr in that line.
Rather than using attributes, I would suggest going all in on custom fields and adding a bound field to POOrder. This will serve you better and with less complications.
Yes, I know if we wants to add any column we need to extend DAC.
But I am searching code that pull data from attribute.
For new development yes we can go with custom fields but sometimes we need to extend existing development. UDF already present. Now we just need to display.
...sometimes we need to extend existing development. UDF already present.
We’ve all been there.
Try something like this in your FieldSelecting event for the APTran extension field:
protected virtual void _(Events.FieldSelecting<APTranExt.usrProNbr> e) { APTran row = e.Row; if (row is null) return;
var purchaseGraph = PXGraph.CreateInstance<PurchaseOrderEntry>(); POOrder order = purchaseGraph.Document.Search<POOrder.orderNbr>(row.PONbr, row.POOrderType);
var udfValue = purchaseGraph.Document.Cache.GetValueExt(order, "AttributePRONBR") as PXStringState;