Skip to main content
Solved

How to access UDF on other screen.


Forum|alt.badge.img

I created string type attribute and used on Purchase Orders screen.

Attributes
UDF 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

bjani23 wrote:

...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;

    e.ReturnValue = udfValue;
}

 

View original
Did this topic help you find an answer to your question?

5 replies

mianniello80
Jr Varsity III
Forum|alt.badge.img
  • Jr Varsity III
  • 14 replies
  • June 18, 2024

Hello @bjani23,

This would require customization in order to push the value you gave the UDF on the PO to carry over to the Bill.

 

Hope this helps.


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • 20 replies
  • June 18, 2024
mianniello80 wrote:

Hello @bjani23,

This would require customization in order to push the value you gave the UDF on the PO to carry over to the Bill.

 

Hope this helps.

Yes I am trying to make change using code. But I cannot find any help that show me how can we get attribute value.

Basically on Bills and Adjustment screen we have PO number. Base on that I wants to pull attribute value. 


darylbowman
Captain II
Forum|alt.badge.img+13

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.


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • 20 replies
  • June 18, 2024
darylbowman wrote:

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.


darylbowman
Captain II
Forum|alt.badge.img+13
  • 1608 replies
  • Answer
  • June 18, 2024
bjani23 wrote:

...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;

    e.ReturnValue = udfValue;
}

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings