Security on tab level on Card Form

hi I am using Navision-2.60. My client wants that some user should not see some of the tabs on the ITEM card. More specifically he does not want some of the user to see the INVOICING TAB on the ITEM CARD. As far as i know we cannot do that in Navision2.60 with security option (ie Defining Roles for that), unless we design a new card without Invoicing Tab. Is there any alternative for the same. Thanks Harikesh

No, there is no way to control the tabs via the security functionality in 2.60. What you might consider instead is to control the field appearance rather than building a new form… You define a special role for viewing the fields of the INVOICING tab and hardcode in the OnOpenForm trigger of the item card that if the user doesn’t have this role then the fields on this form should have the property visible set to false (e.g. CurrForm.UnitCost.VISIBLE := FALSE;) Saludos Nils

You could also put the controls in a frame, and make that control visible/invisible. Also, remember to stop the client from having zoom rights - otherwise it will ruin the point of your hard work!

Well… in fact there’s a mod developed that works on 2.60 as well as in Attain versions for doing that type of things. It’s called FLS (Field Level Security). If you’re interested on it you can get in contact with Tom Bardos at Western Computer.Just send me an e-mail if you’re interested on his e-mail address for contacting him. Regards,

Hi Harikesh Some time back i had a similar kindaa requirement, then this what i have done, i dunno whether if this serves your purpose. what you can do is 1. on the TAB where you wanna put restriction, you can put the follwoing code on the “OnFormatTrigger” of the field (normally i used the first control on that TAB) present on that TAB. IF USERID = ‘HARIKESH’ THEN BEGIN MESSAGE('Sorry you cannot view this Tab… '); CurrForm.“Phone No.”.ACTIVATE; END; 2. Do not use Error statement because, this trigger closes when an error occurs. 3. Try to to set the ACTIVATE property to some field which you think can be seen by that particualr user in the succeding tabs. cheers Kumar

Hi, IF you want apply field security you can use this guidline that i got from our NTR ftp site. Field Level Security This document serves as a guide only. Hence, if you have a better method of implementing the same problem, you may do so. Tables Needed: Master Table Table ID Field ID Table Name Field Name 18 1 Customer No. For every field for which the security is implemented, some code needs to be written on form. Hence, the above table contains master data of all the fields, for which, you have implemented the security. All the rows in this table are inserted by the Developer and client can only choose from this table, rows cannot be inserted in this table by the client. Security Role Code Description CUST Role This Table contains the codes for security role. Role Permissions Code Table ID Field ID Permission (Boolean) CUST 18 1 No This table contains permissions for all the roles. By permissions, we mean yes and No for the fields that the user can or cannot see on all the forms. Client can set these permissions themselves for all the fields of the master table. • Code field has a look-up to the Security Role table. • Table ID and Field ID fields have a lookup to Master table. Existing Table 91: User Setup Add one field Security Role Code20 Coding on the forms Off-course, the coding must be done on all forms but if you look at the sample code that’s written below, you may realize that it is a very simple code and can be copied and pasted. Moreover, there is a very slim possibility that these field numbers may change hence, this code might run for a very long time. Example: Customer Card New Function: Apply_Security() UserSetup.GET(USERID); Role Permissions.SETFILTER(Role, UserSetup.Security Role); Role Permissions.SETFILTER(Permission, false); If Role Permissions.FIND(‘-‘) then REPEAT CASE “Field ID” OF 1 : CurrForm.”No.”.visible = false; …. …. So on END; UNTIL Role Permissions.NEXT = 0; Call this function from OnOpenForm();

Why not just keep it simple. Create a new form, open that form from a buton or menu item and let the normal security and permission system handle the rest?

quote:


Originally posted by lstroem
Why not just keep it simple. Create a new form, open that form from a buton or menu item and let the normal security and permission system handle the rest?


Because… sometimes it’s not as easy. Typical example with the item card: The customer wants the guys at the warehouse being able of seeing the item card data excepting the cost of the item (as they’re not interested on having those guys knowing the profit the company is making). The warehouse guys have access to shipping and order creation. They also have access to the posted shipments and a few more forms. If you remove them the permission for going to the item card on standard security and make a new form, whenever they’re creating a new order you’re making them leaving the order for checking (as example) the item’s quantity on purchase orders (unless you modify the item list… too for not going to the standard item card). Whenever they click on the item line on the field No. and they go tho the generic item list… they’ll be getting erros when trying to get into the item card. It’s easier just hiding those fields and having not to create new forms or modify the existant ones. Another reason is that if i’ve 6 different groups of users that are having different permissions for seing the data on the same form, i’ve to create 6 different forms one for each group. If you take in consideration that you have to pay for the number of forms in your license (packs of 100) that’s another reason. Another reason is that if you’ve different forms and you want to add some functionality you’re having to copy that functionality to the different forms instead of just doing it once. Another reason is having a clear functionality… doesn’t make sense having 2 or 3 buttons named item card and getting errors when using 2 of them… Regards,