53
We would like to have a possibility that gives you the oppurtinity to suppress a CodeCop warning per line.
Why? Here is an example:
We got a warning "Possible overflow assigning 'Text' to 'Text[50]'.AL(AA0139)". Usually, this warning is correct and should be resolved, but we have a case where we want to cancel the transaction by an error.
There are two ways:
1. Assign the value, that is too long for the variable, and maybe throw the default NAV/BC overflow error (not resolving the warning).
2. Check if the value is too long and throw an own error. Otherwise use "copystr" too assign the value and suppress the warning.
We would like to use the first approach because we do not want to write another error that is almost the same. But if we are followin the first approach, the codeline is underlined in yellow and the whole file is marked that there are warnings in it.
Solution:
Something like a //ignore-Tag in the line that should be not checked would be helpful.
Why? Here is an example:
We got a warning "Possible overflow assigning 'Text' to 'Text[50]'.AL(AA0139)". Usually, this warning is correct and should be resolved, but we have a case where we want to cancel the transaction by an error.
There are two ways:
1. Assign the value, that is too long for the variable, and maybe throw the default NAV/BC overflow error (not resolving the warning).
2. Check if the value is too long and throw an own error. Otherwise use "copystr" too assign the value and suppress the warning.
We would like to use the first approach because we do not want to write another error that is almost the same. But if we are followin the first approach, the codeline is underlined in yellow and the whole file is marked that there are warnings in it.
Solution:
Something like a //ignore-Tag in the line that should be not checked would be helpful.
STATUS DETAILS
Completed
Business Central Team (administrator)