web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Reg - Customizing the selected lines to view alone respected page for particular item

(0) ShareShare
ReportReport
Posted on by 190

Hi Friends,

I'm stuck in a part that actually my requirement is to :

I have to select the single line in a page and I should ADD Action button

After when I select that line and click action button it should display the variant that is specifies only for the particular Item what I added to the variants.

For Example , You can take in Item Card as an example  when you click Item availability by variant it specifies particular thing alone  

rather In lines I want to select and view ...using AL CODE

Thanks & Regards

Karthikeyani C

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,708 Moderator on at

    Hi,

    I think somewhere you have to tell the system which line you want to select, for example if there are 100 lines, For which line you want to see the Variant, in that case you have to use a Dialog window should open, ask the particular Item and then show the variant for that selected item if found in the sales lines.

    Thanks.

  • karthikeyani c Profile Picture
    190 on at

    Yes, Absolutely correct

    but I didn't know and so much confused like how to code in my existing pages and tables

    can you please teach with  the syntax so I can get a better understanding.

    Thanks & Regards ,

    Karthikeyani C

  • karthikeyani c Profile Picture
    190 on at

    On the list page, how to show variants on selected lines and that should be selected and update in another Page.

    This is what I'm trying to ..

    Thanks and Regards ,

    Karthikeyani C

  • Suggested answer
    Nitin Verma Profile Picture
    21,708 Moderator on at

    Hi,

    I have tried to create some AL objects for you, for just an idea, more you can changes according to your need.

    pageextension 60100 "Modify SubSOPage" extends "Sales Order Subform"
    {
        actions
        {
            addafter("F&unctions")
            {
                action(VariantSelection)
                {
                    ApplicationArea = All;
                    Caption = 'Select Variant';
                    Promoted = true;
                    PromotedIsBig = true;
                    PromotedCategory = Process;
                    image = SelectEntries;

                    trigger OnAction()
                    var
                        VariantSelection: Page "Variant Selection";
                    begin
                        if rec.Type = rec.Type::item then begin
                            VariantSelection.SetRequest(rec."No.");
                            VariantSelection.RunModal();
                        end;
                    end;
                }
            }
        }
    }
    page 60102 "Variant Selection"
    {
        Caption = 'Variant Selection';
        PageType = ConfirmationDialog;

        layout
        {
            area(content)
            {
                group(General)
                {
                    field(ItemNo; itemNo)
                    {
                        ApplicationArea = all;
                    }
                }
            }

        }
        trigger OnQueryClosePage(CloseAction: Action): Boolean
        var
            ItemVariant: Record "Item Variant";
        begin
            ItemVariant.Reset();
            ItemVariant.SetRange("Item No.", ItemNo);
            Message('There are total %1 Variant found for Item No. %2', ItemVariant.Count, ItemNo);
        end;

        procedure SetRequest(ItemNo2: code[20])
        begin
            ItemNo := ItemNo2;
        end;

        var
            ItemNo: code[20];
    }
  • Suggested answer
    Amit Baru Profile Picture
    3,037 on at

    Hi,

    please share the written code, I will check and correct it.

    Regards

    Amit Sharma

    www.erpconsultors.com

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,664

#2
YUN ZHU Profile Picture

YUN ZHU 960 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 773 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans