Skip to main content

Hi every one,

I have a custom field on POLine named “Custom Note” (UsrCustomNote)

I want to bring this field to POReceiptLine when creating Purchase Receipt by click button “ENTER TO RECEIPT”

The goal like:

 

Could you please help me?

 

Regards,

Khoi

Hi @mrthanhkhoi  Below is the code to bring the Custom Note field from the Purchase Orders Line to Receipt Line.

 

I have verified with the below and it is working fine.

   public class POReceiptLineExt : PXCacheExtension<POReceiptLine>
{
PXDBString(100,IsUnicode =true)]
PXDefault(typeof(Search<POLineExt.usrCustomNote,Where<POLine.orderType,Equal<Current<POReceiptLine.pOType>>,
And<POLine.orderNbr,Equal<Current<POReceiptLine.pONbr>>,
And<POLine.lineNbr,Equal<Current<POReceiptLine.pOLineNbr>>>>>>), PersistingCheck = PXPersistingCheck.Nothing)]
public string UsrTestField { get; set; }
public abstract class usrTestField : PX.Data.BQL.BqlString.Field<usrTestField> { }

}

 

 

 


Hi @Naveen Boga,

thank you very much for your question.

In addition, How to update value of this field when we make an update on the field usrCustomNote on POLine? it means: update field usrCustomNote on POLine → sync this value to the field on POReceiptLine

 

Could you please help me on that?

 

Regards,

Khoi


@mrthanhkhoi  You follow the below steps.

  1. Extend the POOrderEntry Graph
  2. Override the Persist method to write a logic to update the field in the POReceiptLine
  3. In logic, you can create the POReceiptEntry graph object
  4. Fetch POReceiptLine with the fields POOrderType, POOrderNbr and POLineNbr
  5. assign the value from POLine field to POReceiptLine field
  6. Update the cache
  7. Save the POReceiptEntry graph.

Note: You cannot edit the PO when status is in OPEN and can only edit when PO is in HOLD status.

 


Hi @Naveen Boga  

thank you very much for your help.

 

Have a nice day!


Reply