IncludeInDataSet property for Boolean variable on Pages (2016-2018 nav)

DrakonianDrakonian Posts: 14Member
edited 2018-07-11 in NAV Three Tier
Hello, my question is why should use IncludeInDataSet YES property for Boolean variable on Pages?
If it is Request Page on report it is must or user will get runtime error.

But for some reason Page 1, 21 or etc. use that property for booleans which used on Editable/Visible/Enabled/StyleExpr property.

In the documentation I found this(2016):
Remarks
You must set this property to Yes if the variable is used as the value of the Editable Property, Enabled Property, Visible Property, or StyleExpr Property.
https://docs.microsoft.com/en-us/dynamics-nav/includeindataset-property

Great. But all works fine if IncludeInDataSet = No

I have nowhere found the reasons why should use IncludeInDataSet. No one example when variable works not correctly.

Just words: set plz IncludeInDataSet = Yes for editable/visible/etc.

I'm talking specifically about the versions of 2016-2017-2018. And not about reports request pages.

Hope someone can help me to understand. Otherwise I can not sleep peacefully :|

Comments

  • KishormKishorm Posts: 908Member
    Hi @Drakonian, you do need this otherwise it doesn’t work properly when you change the value of your variable. If not set then it will only use the initial value that was set when the page was opened.

    As a test create a Boolean variable and set it based on the value of field in the table used on the page - do this on the OnAfterGetRecord of a list page. Then use the variable to set the Enabled or Editable property of one of the fields on the list page (don’t use it for Visible). You’ll find that this only works correctly when the IncludeInDataset property is used.
  • DrakonianDrakonian Posts: 14Member
    Kishorm wrote: »
    Hi @Drakonian, you do need this otherwise it doesn’t work properly when you change the value of your variable. If not set then it will only use the initial value that was set when the page was opened.

    As a test create a Boolean variable and set it based on the value of field in the table used on the page - do this on the OnAfterGetRecord of a list page. Then use the variable to set the Enabled or Editable property of one of the fields on the list page (don’t use it for Visible). You’ll find that this only works correctly when the IncludeInDataset property is used.
    Hi @Kishorm, test your solution it always works fine. I am testing on 2018 Nav.
    With IncludeInDataSet = Yes or No, it does not matter.
  • mohana_cse06mohana_cse06 Posts: 5,455Member
    AFAIK, it needed in older versions but not in latest versions.
    But I also read that Performance will be low if you set to no while using for editable,visible etc cases.
  • KishormKishorm Posts: 908Member
    Just done a quick simple test and found the same. I definitely have had it not working quite right in some circumstances if I don’t set the property, I just can’t remember when.
  • DrakonianDrakonian Posts: 14Member
    Kishorm wrote: »
    Just done a quick simple test and found the same. I definitely have had it not working quite right in some circumstances if I don’t set the property, I just can’t remember when.

    Looks like it was on Request Pages or Nav 2009-2013.
Sign In or Register to comment.