Options

Disable a field based on user name

Hi All,

how can we disable a field of a page from the C/AL Code ?

I need to disable a field that based on user

thanks ,

Best Answer

Answers

  • Options
    mohana_cse06mohana_cse06 Member Posts: 5,503
    Create a global Boolean variable with property Include in dataset
    write the code in OnOpenpage trigger or onvalidate trigger depending upon your requirement to make the above variable true/false.
    add the Boolean variable in field property visible/editable etc
  • Options
    Hi Mohana,

    i am quite confuse with your third line ?

    can you elaborate ?

    thanks,
  • Options
    postsauravpostsaurav Member Posts: 708
    Answer ✓
    Hi,

    What mohana meant with third line is -
    1. In Page designer select the row where field is placed.
    2. Navigate to its properties shortcut SHift + F4.
    3. In Properties you will see editable / visible / enable. whatever you want to set based on user specify that boolean on that particular property value.

    Hope it make sense.

    Thanks & Regards,
    Saurav Dhyani

    Do you Know this About NAV?


    Connect - Twitter | Facebook | Google + | YouTube

    Follow - Blog | Facebook Page | Google + Page
  • Options
    @mohana_cse06 : thanks,
  • Options
    aceXaceX Member Posts: 166
    I think the best way to do this is creating new boolean field in User Setup table. Maybe the same setup after time you will need to have for other users. Then you will need to write a code ... That is not recommended.
    When you will have the bool field (Show Fields on MYPAGE), in the page you will write

    variableusedindataset := FALSE;
    RecUserSetup.GET(USERID);
    IF RecUserSetup."Show Fields" THEN
    variableusedindataset := TRUE;

    in Editable property you will write variableusedindataset.
    When you will need to allow other user edit that field, you will just check it in User Setup table for that user.

    Best Regards
  • Options
    guidorobbenguidorobben Member Posts: 157
    use the AccessByPermission property on the field.
Sign In or Register to comment.