Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Unanswered

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

Posted on by 17
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;


 
}



 
Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans