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?
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,
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;
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.
Looking at your code, you do a setrange, but don't you need a find after that to get the appropriate record to modify?
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
Hi,
You can define the flowfield in the header table and use calcformula property to find if the line field is true.
Regards,
YSR
Hi Sankar,
Based on the question asked here is my sample AL code suggestion for you:
Don't forget to LIKE & VERIFY, if it helps anyway.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,104 Most Valuable Professional
nmaenpaa 101,156