StefanMaron / BusinessCentral.LinterCop

Community driven code linter for AL (MS Dynamics 365 Business Central)
https://stefanmaron.com
MIT License
72 stars 30 forks source link

LC0064 - False positive on page controls not using Rec. #681

Open fvet opened 2 months ago

fvet commented 2 months ago

I've a page based on table 'Document' (with a field "Error Rows").

LC0064 shows up for a lot of page field controls having Rec.FieldNo as source expression. Fixing those errors in batch (using code actions from AL v14.x) moves the tooltips from the page to the table, which is fine.

However, LC0064 shows up for page field controls referencing AnotherRecord.FieldNo value (AnotherRecord references the same table as the page SourceTable). If I would perform the codeaction, the tooltip is moved from the page to the (AnotherRecord) table, which seems ok. Although, when publishing a new version of the app, the page field does not longer inherit the tooltip from the (AnotherRecord) table.

Seems like inheritance of table tooltips only works for Rec variables.

image

Requested change:

PS: Not sure if the should be logged on https://github.com/microsoft/AL to ensure either the codeaction excludes those cases and if the runtime should inherited tooltips from non Rec. values as well.

Arthurvdv commented 2 months ago

.. the page field does not longer inherit the tooltip from the (AnotherRecord) table

This is not the behavior I would expect and I'm thinking that you may have found a bug. I would suggest raising this issue on the https://github.com/microsoft/AL and depending on the response adapt the rule (if necessary).

Do you want to do the honors of creating an issue?