You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`var
CompanyTheme : Record CompanyTheme
this line is the issue :
payload := '&DateDebut=' + dateDebut + '&DateFin=' + DateFin + '&Theme=' + FORMAT(CompanyTheme."Thème");`
Expected behavior*
I think CompanyTheme."Thème" should return AF and not "AF - Actualités financières" because I need to send to my API only the AF and I don't think just cutting the first 2 string of Theme is the right idea...
5. Versions:
AL Language: 4.0.209944
Business Central: 15.1 (and 15.2)
The text was updated successfully, but these errors were encountered:
This is by design. The Format works the same way as for Option fields to ensure backwards compatibility.
The scenario is perfectly valid though. Unfortunately we don't have an ideal way of doing this right now. From Version 4.0 of AL you can do something like
procedure GetEnumValueName(e: enum TestEnum): Text;
var
index: Integer;
name: Text;
begin
index := e.Ordinals.IndexOf(e.AsInteger());
e.Names.Get(index, name);
exit(name);
end;
procedure GetEnumValueName(fref: FieldRef): Text;
begin
exit(fref.GetEnumValueNameFromOrdinalValue(fref.Value));
end;
Describe the bug
When trying to use an enum and send it to an API, it is sending the caption instead of the value.
To Reproduce
Have an enum :
Use this enum in a table :
In a codeunit,
Expected behavior*
I think CompanyTheme."Thème" should return AF and not "AF - Actualités financières" because I need to send to my API only the AF and I don't think just cutting the first 2 string of Theme is the right idea...
5. Versions:
The text was updated successfully, but these errors were encountered: