Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Unanswered

Running this RunObject = page QualityDialog; RunPageLink = "Item No." = field("No.");

Posted on by 8
Hello experts I have a requirement.
1.  Here is the following code that inserts some records into the table named buffer table, here the problem is these 2 lines in my code run before the record inserting.  
RunObject = page QualityDialog;
                RunPageLink = /Item No./ = field(/No./);
2. Here I need the same 2 lines do requirements after inserting these records,
3. here is what I need after inserting those records it should open the dialog box with the matched records in detail this 
RunPageLink = /Item No./ = field(/No')

shows the matched records of the buffer table by validating with the filed named (No.) of the purchase line.

Here is the Main code.
pageextension 71516710 myect extends /Purchase Order Subform/
{
    actions
    {
        addafter(BlanketOrder)
        {
            action(Quality)
            {
                ApplicationArea = All;
                Caption = 'Quality';
                Image = Action;
                ToolTip = 'Open the quality dialog box for the selected item';
 
                RunObject = page QualityDialog;
                RunPageLink = /Item No./ = field(/No./);



 
                trigger OnAction()
                var
                    QualityDialog: Page QualityDialog;
                    QualityCode: Record QualityCodeTable;
                    Item: Record Item;
                    PurchaseLine: Record /Purchase Line/;
 
                begin
                    CurrPage.SetSelectionFilter(PurchaseLine);
                    if PurchaseLine.FindFirst() then begin
 
                        if (PurchaseLine.Type = PurchaseLine.Type::Item) or (PurchaseLine.Type = PurchaseLine.Type::/Fixed Asset/) then begin
                            Item.Get(PurchaseLine./No./);
                            if Item./Quality Applicable/ and (Item./Quality code/ <> '') then begin
                                MyProcedure(Item, PurchaseLine, QualityDialog);
                            end
                            else
                                Error('The item %1 does not have a quality code assigned.', Item./No./);
                        end
                        else
                            Error('The item %1 is not quality applicable.', Item./No./);
                    end
                    else
                        Error('The line type %1 is not supported for quality.', PurchaseLine.Type);
 
                   
                end;


 
            }




 
        }
    }
 
    var
        PurchaseHeader: Record /Purchase Header/;
 
    local procedure MyProcedure(var Item: Record Item; var Rec: Record /Purchase Line/; var DialogBox: Page QualityDialog)
    var
        MainTable: Record QualityCodeTable;
        PartTable: Record QualityParamater;
        qualityparasubform: Record QualityParamaterSubform;
        BufferTable: Record QualityCodeTabletestdialoug;
        PurchaseLine: Record /Purchase Line/;
        ItemFilter: Record Item;



 
    begin
 
        qualityparasubform.SetRange(/No./, Item./Quality code/);
        qualityparasubform.SetRange(/Item No./, Item./No./);
        if qualityparasubform.FindSet() then begin
            repeat
                BufferTable.SetRange(Number_buffer, qualityparasubform./No./);
                BufferTable.SetRange(/Item No./, qualityparasubform./Item No./);
                BufferTable.SetRange(/Quality Parameter Code/, qualityparasubform./Quality Paramater Code/);
 
                if not BufferTable.FindFirst() then begin
                    BufferTable.Init();
                    BufferTable.Number_buffer := qualityparasubform./No./;
                    BufferTable./Item No./ := qualityparasubform./Item No./;
                    BufferTable./Line No/ := qualityparasubform./Line No/;
                    BufferTable./Quality Parameter Code/ := qualityparasubform./Quality Paramater Code/;
                    BufferTable.Particulars := qualityparasubform.Particulars;
                    BufferTable./Approved Parameters/ := qualityparasubform./Approved Parameters/;
                    BufferTable./Unit of Measurement/ := qualityparasubform./Unit of Measurement/;
                    BufferTable.Remarks := qualityparasubform.Remarks;
                    BufferTable.Insert(true)
                end
                else begin
                    BufferTable.Number_buffer := qualityparasubform./No./;
                    BufferTable./Item No./ := qualityparasubform./Item No./;
                    BufferTable./Quality Parameter Code/ := qualityparasubform./Quality Paramater Code/;
                    BufferTable./Line No/ := qualityparasubform./Line No/;
                    BufferTable.Particulars := qualityparasubform.Particulars;
                    BufferTable./Approved Parameters/ := qualityparasubform./Approved Parameters/;
                    BufferTable./Unit of Measurement/ := qualityparasubform./Unit of Measurement/;
                    BufferTable.Remarks := qualityparasubform.Remarks;
                    BufferTable.Modify();
 
                end;
 
            until qualityparasubform.Next() = 0;













 
end;
 
    end;


 
}



 

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,986 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,588 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans