Visible / Invisible Fields on a role - basis

wakestarwakestar Member Posts: 207
edited 2009-04-17 in NAV Three Tier
Hi there

Is it possible make certain Fields (in)visible for certain profiles (roles)?
For instance I have the field 'top secret' on the customer card (page) which should be visible only for one special role.
All the users from other profiles (roles) should not be able to see it... and not able to select the field through the page customization wizard.

Thanks

Comments

  • kinekine Member Posts: 12,562
    No, you cannot limit it without removing it from the page and make the pages separated for the profiles...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • wakestarwakestar Member Posts: 207
    In a scenario where you have a customer database with lots of companies, each working with a different view (fields) on a customer card for instance... you would manage (in)visible fields programmatically with CurrPage."Field Name".VISIBLE, instead of creating different roles or pages for each company, right?
  • kinekine Member Posts: 12,562
    wakestar wrote:
    In a scenario where you have a customer database with lots of companies, each working with a different view (fields) on a customer card for instance... you would manage (in)visible fields programmatically with CurrPage."Field Name".VISIBLE, instead of creating different roles or pages for each company, right?

    Yes, but it will not prevent user to make it visible through "Show columns" (of course, you can disable this functionality through code). But on pages, I am not sure if you can disable the "Customize this page..."... :wink:
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ara3nara3n Member Posts: 9,255
    You could control it through permission and allow read only acces to the User Metadata. I haven't tried it yet.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • kinekine Member Posts: 12,562
    ara3n wrote:
    You could control it through permission and allow read only acces to the User Metadata. I haven't tried it yet.
    On RTC? Hmmm... good to know...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ara3nara3n Member Posts: 9,255
    kine wrote:
    ara3n wrote:
    You could control it through permission and allow read only acces to the User Metadata. I haven't tried it yet.
    On RTC? Hmmm... good to know...


    Just wanted to emphasize I have not tried it yet.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • kinekine Member Posts: 12,562
    :oops: Monday... :mrgreen:
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    You could control it through permission and allow read only acces to the User Metadata. I haven't tried it yet.
    You shouldn't do that [-X - that would remove personalization from all pages and would 100% sure make the RTC behave weird if the user inserts a column on a page and closes it (probably crash)

    BTW - fields which are hidden by a false expression in the VISIBLE expression on the field (whether it is a column or a field) cannot be shown through personalization. Note though that the visible expression will only be validated on Page Open - and you cannot set this later on.
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • wakestarwakestar Member Posts: 207
    I did some prototyping and the hidden functionality worked well on a list part.
    But in case of a card it only works on fields on the first FastTab (General), on all other FastTabs the field appears "inactive" but is not hidden. The field "currency code" on the customer card is a good example for this case.


    Update: Sorry, in case of a card it only works as long as the user is not customizing the page. After he changes the page, the field appears inactive instead of hidden. It doesn't have anything to do with the FastTab.
  • dmc-dkdmc-dk Member Posts: 42
    freddy.dk wrote:
    BTW - fields which are hidden by a false expression in the VISIBLE expression on the field (whether it is a column or a field) cannot be shown through personalization.

    I have a field control on a Card page which has Visible property set to FieldIsVisible (Boolean global variable, IncludeInDataset = Yes).
    I add this code to the page:
    OnOpenPage()
    FieldIsVisible := FALSE;
    

    Now when I open the page on RTC the field is not visible, but i can add it though personalization (click on Customize - Customize this Page - etc.) :-k
  • dmc-dkdmc-dk Member Posts: 42
    So what will be the conclusion for displaying "top secret" fields based on user role(profile)?
    Creating separate forms with separate sets of fields?
  • ara3nara3n Member Posts: 9,255
    Yes creating new forms/pages, just like in classic.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • wakestarwakestar Member Posts: 207
    or wait and hope that it will be possible in a later version / service pack
    as I wrote earlier, "top secret" fields are possible on list parts... but unfortunately only on list parts
  • jreynoldsjreynolds Member Posts: 175
    There is a new property available for fields on pages called HideValue. You may be able to use this; the field would still be visible but the value would be hidden.
  • dmc-dkdmc-dk Member Posts: 42
    jreynolds wrote:
    There is a new property available for fields on pages called HideValue. You may be able to use this; the field would still be visible but the value would be hidden.

    ... that is until you put a cursor into it - then the hidden value becomes visible! :shock:
    That I did not expect. What is the point of this feature then?
  • TroelshTroelsh Member, Microsoft Employee Posts: 79
    We do show the data when the control has focus AND is in edit mode - to enable the user to see what he is entering.

    If you don't want the user to see the data - make the control non-editable (or open the page in view-mode)

    Troels Bent Hansen
    Senior Program Manager
    Microsoft Dynamics NAV


    ****** This posting is provided "AS IS" with no warranties, and confers no rights ******
Sign In or Register to comment.