Showing posts with label PR to PO (Product receipt level). Show all posts
Showing posts with label PR to PO (Product receipt level). Show all posts

Tuesday, September 2, 2025

If a How to get Purchase Order (PO) is linked to a Purchase Requisition (PR), fetch the Name from the PR and populate it in the Description field of the Product Receipt form.

 If a Purchase Order (PO) is linked to a Purchase Requisition (PR), fetch the Name from the PR and populate it in the Description field of the Product Receipt form.


[ExtensionOf(formDataSourceStr(PurchEditLines,PurchParmTable))]

internal final class PurchParmTableFormDataSource_Extension

{

    public void executeQuery()

    {

        next executeQuery();

        PurchReqTable purchReqTable;

        PurchReqLine  purchReqLine;

        FormStringControl   Invoicedescription = this.formRun().design().controlName("PurchParmTable_Description");

        PurchParmTable purchParmTable = this.cursor();

 

  

        select firstOnly purchReqLine

            where purchReqLine.PurchId == purchParmTable.PurchId

            && purchReqLine.INVENTDIMIDDATAAREA == purchParmTable.DataAreaId;

           

        if (purchReqLine.RecId)

        {

       

            select firstOnly purchReqTable

                where purchReqTable.RecId == purchReqLine.PurchReqTable;

 

            if (purchReqTable.RecId)

            {

               

                purchParmTable.Description = purchReqTable.PurchReqName;

                Invoicedescription.allowEdit(false);


            }

        }

        else

        {

            

            FormStringControl descriptionCtrl =  this.formRun().design().controlName('PurchParmTable_Description'); // Control name in the form

               

            if (descriptionCtrl)

            {

                descriptionCtrl.mandatory(true);

            }

        }

    

 

 

    }


}

Purchase Orders

 Before confirming a Purchase Order, the system should display a confirmation popup if the purchase order is associated with an active inter...