Open LucaRoesnick opened 1 month ago
What happens if you explicitly add AL0780 to a ruleset file (as Warning
)?
I'm asking due to this: #7787
No difference at all.
Tried Error
as well, and it didn't change anything as well.
(Bump)
Are there any news regarding this issue as BC25 comes closer (preview available expected in 2 weeks)?
Sorry for the time taken to get to this. I finally looked into the history of this error and it's very misleading.
Initially this was introduced to catch the exact case that you refer to where we wanted to prevent assignment to fields that were flowfields. However this was walked back after feedback from our internal app developers (the dev who did the rollback is currently away, so I can't say specifically why. All I have is a statement that "there are legitimate use cases").
However this error code was left in, and it's used in one specific case which the message doesn't even have anything to do with. This case is when you invoke ModifyAll
on a record and target a field of FieldClass = FlowField
. So in the example given, if there was:
procedure MyProc()
var
r: Record TESTAL0780;
begin
r.ModifyAll(r.ItemNo, '2000'); // should invoke AL0780
end;
So in short, the message is very misleading and not at all accurate with regards to how the actual error is being used. If you're not seeing it as a warning now, you won't be getting this as an error in BC25. I will however accept this with the intent to actually make the message accurate.
1. Describe the bug
The diagnostic AL0780 is currently not resulting in a warning or an error. Even though it is supposed to become an error in Business Central 2024 release wave 2.
https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/diagnostics/diagnostic-al780
The diagnostic should result in a warning before runtime 14.0, and should result in an error with runtime 14.0.
2. To Reproduce
3. Expected behavior
The mentioned Code snippet should result in an error or in a warning.
4. Actual behavior
The mentioned Code snippet is not resulting in an error or in a warning.
5. Versions: