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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Want to get tick on my check box if my field is true

(0) ShareShare
ReportReport
Posted on by 75

Here I have a alertine table where if warning field is yes then I

Want  my  checkbox (which is in alert header table)ticked in Al code how can we do that?

I have the same question (0)
  • Verified answer
    TabrezAjaz Profile Picture
    202 on at

    Hi Sankar, 

    Based on the question asked here is my sample AL code suggestion for you: 

    sample-code.PNG

    Don't forget to LIKE & VERIFY, if it helps anyway.

  • Suggested answer
    Yogender Singh Rana Profile Picture
    80 on at

    Hi,

    You can define the flowfield in the header table and use calcformula property to find if the line field is true.

    Regards,

    YSR

  • Shankar Profile Picture
    75 on at

    Here is my code:

    Alertline.setrange("Document.No',Alertheader."No.")

    If Alertline.warning = true then

    Begin

    Alertheader.setrange(No, Alertine.No)

    Alertheader.ticked := yes;

    Alertheader.modify()

    End

    When item has alert field yes then my alertheader checkbox is not ticked What can be done.? Here

  • Suggested answer
    Dallefeld Profile Picture
    235 User Group Leader on at

    Looking at your code, you do a setrange, but don't you need a find after that to get the appropriate record to modify?

  • TabrezAjaz Profile Picture
    202 on at

    Hi Shankar,

    Can you give more information about, Item having a field alert?

    When using SetRange the any type of find is required if not using any find methods, then make sure to have check for Record.IsEmpty.

    After you got the desired filtered record then you can modify your records, if there are more than one records in filter then you can use repeat....until to traverse each filtered record.

    Provide more information about your tables and the fields on which you are trying to do something.

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    You will have to do something like this:

    Alertline.setrange("Document.No',Alertheader."No.")

    If Alertline.findset(Treu,false) then repeat

    If Alertline.warning = true then

    Begin

    Alertheader.setrange(No, Alertine.No)

    Alertheader.ticked := yes;

    Alertheader.modify()

    End

    until Alertline.next() =0;

  • Shankar Profile Picture
    75 on at

    Hi, Tabrez, here I have created assembly orders, and I have extended warning field in assembly line so when I add item the field is yes, then the field avail warning which I extended in assembly header should be ticked,

    This is my code what wrong in this,

    codeunit 50103 ExtAssembly

    {

        procedure MyProcedure()

        var

            AssemblyLines: Record "Assembly Line";

            AssemblyHeader: Record "Assembly Header";

            availableWarning: Boolean;

            Enum_DocumentType: Enum "Assembly Document Type";

        begin

            AssemblyHeader.SetRange("No.", AssemblyLines."Document No.");

            AssemblyHeader.SetRange("Document Type", Enum_DocumentType::Order);

            // availableWarning := AssemblyLines.FindFirst();

            if AssemblyHeader.FindSet() then

                repeat

                    AssemblyLines.SetRange("Avail. Warning", true);

                    if AssemblyLines."Avail. Warning" = true then begin

                        AssemblyHeader."Avail. Warning" := true;

                        AssemblyHeader.Modify();

                    end;

                until AssemblyLines.Next() = 0;

        end;

    }

    Can you please updates in this , as I am not getting my (assembly header) checkbox checked if the field is yes in assembly line. So,

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 653 Super User 2026 Season 1

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 414 Most Valuable Professional

#3
YUN ZHU Profile Picture

YUN ZHU 394 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans