Allow user to ship only

Dears,
how can I prevent a user from (ship and invoice) and (invoice) while posting a sales invoice? I just want to let this user (ship) only.

Regards,

Answers

  • RockWithNAVRockWithNAV Member Posts: 1,139
    edited 2017-04-17
    go to codeunit 81, there you will find this code

    Selection := STRMENU(Text000,3);
    IF Selection = 0 THEN
    EXIT;
    //ADD THIS CODE
    IF Selection = 3 OR Selection = 2 THEN
    ERROR(Not Allowed)
    //ADD THIS CODE
    Ship := Selection IN [1,3];
    Invoice := Selection IN [2,3];

  • maheshroyal34maheshroyal34 Member Posts: 19
    edited 2017-04-18
    Hi,

    Can adjust the code in CU 81 like below,

    Declare Text Constant variable Text003 = &Ship

    //Selection := STRMENU(Text000,3);
    Selection := STRMENU(Text003,1);
    IF Selection = 0 THEN
    EXIT;
    Ship := Selection IN [1,1];
    //Invoice := Selection IN [2,3];

    Then user can have access and visible to "Ship" option only.

    366222iwjv6y.jpg


  • lamislamis Member Posts: 46
    This will be applied to all users, I just want to restrict one user only. Is that possible?
  • maheshroyal34maheshroyal34 Member Posts: 19
    edited 2017-04-18
    Yes, it is possible to restrict particular user, but need to do some customization in code and table level

    we can achieve like below(there may be more other scenarios to customize)

    1. Add a field in table 91 "Onlyship" as boolean and Add the user in user setup, Mark "Onlyship".

    qmz48poyhbr1.jpg

    2. Now adjust the code in Code unit - 81

    Declared Table - 91 (user setup) as global variable with name "gRecUserSetup"
    Declared Text Constant Text003 = &Ship

    customize the code like below in CU-81

    drm5nnr3m787.jpg

    then we can prevent the user to access the other options.

    koww7wmukd64.jpg


Sign In or Register to comment.