Permission rights

Hi all, I have a question about permission rights in Navision. Is there an (easy) way to give additional rights (or filter-settings) to Users when they log in and having only access to a certain range of data (in sales-orders, sales-invoices) including reporting and documenting? For example: a user is allowed to have only access to SalesOrders, SalesInvoices for a specific SalesPerson. That has to be reflected to the usage of reports, documents and journals. Thanks, Roelof.

You will need to do some customisation here, if you want to restrict the user to certain sets of records in a table. what i have done previously is to attach roles to the users ids. from there i can determine what category the user belongs to. after which, based on the user role that is assign to them, i can write a short code to filter the records as the user is about to access them. for example, if you want to restrict the user to seeing only RESALE items in the item card, you will need to write some coding to filter the items. the trick is, you cannot put your coding in the OnOpenForm() trigger of the item card. This will filter the item card, but this does not prevent the user to remove the filter, when the user accesses the form. you will need to create a function in the item table with coding that filters the item with RESALE, then run the item card modally. To prevent the user from removing the filter, you need to use the FILTERGROUP function. the navision item tracking form is a good example. you can examine how the item tracking form is opened from the navision sales invoice. this does not seem easy at all… but anyway, i do hope someone has an easier solution to this…

We had to do a similar thing where we had to have a global filter based on user setup. There is no way to get around putting code on all the necessary forms, however, this is what we did to eliminate updating all the filtered forms if there are future changes to the filtering. We created a codeunit that would handle the filtering(and inserts). Inside of this codeunit we had functions that would filter our records. Once these functions are created, you can put them on the relevent forms. Doing it this way will prevent you from having to change the filter code on every form if the need arises. All the filtering functions are stored in one place so it becomes easier to change the filter rules. Example Codeunit named “Record Management” FilterSalesHeader(VAR SalesHeader : Record “Sales Header”) CheckUserSetup(); WITH SalesHeader DO BEGIN case type of type::Quote: FILTERGROUP(2); //set some filters FILTERGROUP(0); type::Order: FILTERGROUP(2); //set some filters FILTERGROUP(0); //and so on… end; END; Note: You must pass the record by reference(VAR is checked on function parameter) For us it works great Cheers Sorry about the lack of indentation. Taylor McCartney Development Specialist CSB Syst Edited by - tmccartney on 2001 Nov 09 16:24:32

I have an idea now how to solve this problem. Thanks for your help. Roelof.

It’s a good idea to use security filters in Navision Attain. But it works in SQL option only. You can define any Navision-style filter expression applied to any TableData object. In your example it looks as follows: Sales Header: Salesperson Code=JOE Sales Invoice Header: Salesperson Code=JOE Security filter settings will automatically affect all corresponding reports, journals and so on. Regards, Yuri Pokusaev IBS, Senior Consultant NCPS, NCSD +7(095)987-8080

In form/report you can create procedure ApplyUsersFilters() based on some “user filter setup” table. Place this procedure into “OnOpenForm()” and “OnAfterGetCurrRecord()” and/or “OnActivateForm()”. In this case user cannot apply custom filters because entered filter will be overwritten by filtering procedure (OnGetCurrentRecord()/OnActivateForm() triggers). Of cause you cannot control data which is accessed via ODBC/CFRONT. But inside Navision this works. Business Applications Programmer Sertified Navision Developer SIA “Sintegra” Latvia