Open Forum

Disable Toolbar Buttons in Customization Mode

  • 1.  Disable Toolbar Buttons in Customization Mode

    BRONZE CONTRIBUTOR
    Posted 18 days ago
    Is there a way to disable the Toolbar buttons using Customization Mode?  We are trying to prevent certain users from making changes to a PO after it has been printed.  My initial thought was to disable Insert, Delete and Update for these users.  I know that with the SDK, there is the SetButton statement; but I cannot find anyway to do this in VBA.

    ------------------------------
    Chris Sanderson
    Accounting Systems Administrator
    Edison Chouest Offshore
    Cut Off LA
    ------------------------------


  • 2.  RE: Disable Toolbar Buttons in Customization Mode

    BRONZE CONTRIBUTOR
    Posted 17 days ago
    Add a module (or use an existing one) and place this code:

    Public Declare Sub SetButton Lib "swimapi.dll" (ByVal ButtonIds%, ByVal Level%, ByVal OnFlag%)
    Public Const TbInsertButton = 1
    Public Const TbSaveButton = 2
    Public Const TbDeleteButton = 4
    Public Const TbCancelButton = 8
    Public Const TbNextButton = 16
    Public Const TbPreviousButton = 32
    Public Const TbFirstButton = 64
    Public Const TbLastButton = 128
    Public Const TbCurySelButton = 256
    Public Const TbCuryTogButton = 512
    Public Const AllLevels = -1

    Then in Form Load you can add for example:

          SetButton TbInsertButton+TbSaveButton+TbDeleteButton, AllLevels, False



    ------------------------------
    Pat Gibson
    Senior Consultant
    Solomon Cloud Solutions
    Findlay OH
    ------------------------------



  • 3.  RE: Disable Toolbar Buttons in Customization Mode

    SILVER CONTRIBUTOR
    Posted 17 days ago

    We have not found a way to make this happen with a 'SetButton' in customization.
    We created a 'List' table that has screenid, listnbr, and userid.  With it we can set a list of users that have a function (even down to individual buttons and controls) .
    In the Form_Load, we query for a user's list rights in the screen and set appropriate global variables.

    In the event of Delete, save, Insert...
    We use the Update control events
    OnDelete, onUpdate, OnInsert... to evaluate if the user has the function available.
    If not, we display a message and exit with retval = errnomess.

    In this manner you can set your specific business rules and enforcement logic.  We are using this extensively in our system to deal with situations that require more individual rights than are available in the current SL customization.  Many screens have 2 or more of these lists with specific code implement the rule.

    We use  'xListHeader' and 'xListMember' (parent and child)  tables.

    Below is a list (partial) of what we can do....
    ScreenID ListNbr Descr
    0101000 LISTA Allows expanded Batch selections: See Note
    0301000 LISTA Release batches, set terms to A
    0301000 LISTB Enable the terms control for change
    0306000 LISTA Allows releasing of batches
    0401000 LISTA Setting M part over $25 in depot 232
    0425000 LISTA Generate TTOSC reserve/ 224 depot usage
    0425000 LISTB Disable Copy PO button for View Only rights
     0425000 LISTC Access to Company ID on PO Entry
    0425000 LISTD Access to the GPC Review field
    0820000 LISTA Access to Billing Note
    0826000 LISTA Allows Recalc Button and Edit Billing Note
    0826000 LISTB Move/Merge Vessels on Customer Maint.
    0826000 LISTC Set-up unassigned customers
    0826000 LISTD Access to change Salesperson
    1003000 LISTA Gives special features: See Note
    1004000 LISTA Controls who can do 1 step transfer between depots
    1022000 LISTA Allows the use of the Recalc Button
    1025000 LISTB Access to xCondition field (Obsolete/TTOSC) Hazmat Note
    1040000 LISTA Enables the Begin Processing button                         

    4010000 LISTA Access to CM,CR,DM,RFC Order Types
    4011000 LISTA Allows user to modify information for a past period shipper
    4011000 LISTB Allows changing of MINimum GSA Price  (Pwd: LOWPRICE)
    4011000 LISTC Access to CM,CR,DM,RFC Order Types
    SD04000 LISTA Access to only SBM field in Profile Info  (user7)
    SD04000 LISTB Access to Move/merge functionality
    SD04000 LISTC Access to modify/add the Vessel Billing Note
    SD04000 LISTD SMB Field access
    SD20000 LISTA Access to rebill/reverse a call buttons
    SD20000 LISTB Access to transfer Service Call to other Depot
    SD20000 LISTC Access to only rebill button






    ------------------------------
    Mark Schrier
    Information Systems Director
    Mackay Communications, Inc
    Raleigh NC
    ------------------------------



  • 4.  RE: Disable Toolbar Buttons in Customization Mode

    BRONZE CONTRIBUTOR
    Posted 17 days ago
    Thank you all for your replies.  I believe I will go the route of declaring the subroutine in a new module.  It worked just as expected in our test environment.

    ------------------------------
    Chris Sanderson
    Accounting Systems Administrator
    Edison Chouest Offshore
    Cut Off LA
    ------------------------------