I am trying to make sure global variables that refer to dataverse records are always of the correct type (errors may only show up after closing and reopening projects an hard to find among 3000 errors after a day of coding).
So at the start of my app I create variables to records that are blank so i can always assign other record variables (to the same table) to a blank with the correct type.
Set(gRecMyTableBlank,Defaults(MyTable))
Set(gRecMyTableBlank,Blank())
If I omit the first line the variable type is not specified which is what i set out to avoid.
If I omit the second line the variable is not blank. IsBlank(gRecMyTableBlank) = false
If I make a gallery with MyTable populated with lables refering for fields (fe ThisItem.Name) and I want to set items to blank I would expect to be right
[gRecMyTableBlank]
being a table with a blank record of the correct type
But then I get errors on the field names
While if I say
gRecMyTableBlank
(without brackets)
which is fundamentally wrong since I am specifying Items (plural) as a record (single)
I get no errors
Is my thinking wrong?
PS if I create a label outside of the gallery with as text gRecMyTableBlank.Name I get no errors just a blank text