Hi Guys,
I have two fields on my call distribution page.1 Delivery date 2.Delivery Date.
& this Delivery day fields has Enum values.. Mon....Sun like this. as you can see on below screenshot.
I want ,if I select whatever date ,then date relted day will be populated on Delivery day field.
For example : 28/03/2024 -> Thursday, 27/03/2024->Wednesday.
But all this done through a Switch case statement in AL language.
I am writing this logic as seen on below scrrenshot.this logic is also correct.
But As per our requirement we write the code as per switch case statment.
How to do this?
"Dilvery Day" := Enum::"Dilvery Day".FromInteger(dt."Period No.");
trigger OnValidate()
var
dt: Record Date;
begin
if dt.Get(dt."Period Type"::Date, "Delivery Date") then
begin
case dt."Period No." of
1:
"Dilvery Day" := Rec."Dilvery Day"::Monday;
2:
"Dilvery Day" := Rec."Dilvery Day"::Tuesday;
3:
"Dilvery Day" := Rec."Dilvery Day"::Wednesday;
4:
"Dilvery Day" := Rec."Dilvery Day"::Thursday;
5:
"Dilvery Day" := Rec."Dilvery Day"::Friday;
6:
"Dilvery Day" := Rec."Dilvery Day"::Saturday;
7:
"Dilvery Day" := Rec."Dilvery Day"::Sunday;
end;
end;
end;
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,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156