Module to restrict edition of Fields

medianoche
Member Posts: 2
Hi =]
I apologize for my english... and this is my sad story....
I'm doing a module [Access fields] to restrict the edition of fields through a catalog of a Code, tables, fields.
That code is assigned at a user.
For example:
- The user, has roles with permission to access at pages and edit registers of tables of the Module "Sales&Customers".
- Through the new module, I specify that this user couldn't to write in the fields: Description, Search Description and Contact of the Customer table.
- And the user has a error message when wants to edit some of those fields.
The new module [Access fields] uses variables: recordref and fieldref, to make this configuration.
The calling of this configuration is in the trigger OnModify of Customer table.
Ok, well done to this point.
When I access to the Customer table directly, and want to edit one of the these configurated fields, all works fine with the validation and error message.
Buuuut when I access to the customer Card Page, like all the users, to edit the information. I just have the error message about the restriction when I close the Page. When I accept the error message, I lose the changes of ALL fields, not just about the configurated fields.
This is because the trigger Modify of a table, is called when you move of registers or to close the page.
I did other funtion of validation and tested to put the calling it on the trigger OnValidate in each field of a Customer Table, and all works fine. But then, I'll have to put this validation in trigger OnValidate of ALL the fields of tables I want to configurate the restriction fields.
If I add new fields a table and forget to put the validation, I'll lose the funcionality of this new module.
If I put the validation in the trigger Modify of a table is minimum the code to add, and keep the funcionality for new fields.
But yes, this means to modify each object table when I want to add restriction configuration for each table. ](*,)
That's why, I put my code in the codeunit 423 [Change Log Management] because there, I have all data to made the validation [TableNumber, FieldNumber] with my catalog [Module Access Fields] and user.
For this way, I don't have to modify each object table.
I need some *extra configuration*, but all works fine, because I have the development of this new module absolutely dynamic.
Buuuut the code of Change Log Setup is called in each table after de trigger OnModify....
So, I have my error message just when I'm in a edit list and edit, or when I close a Page Card.
Not inmediatly when I edit a field [like in the trigger onValidate]
So, I need a configuration or something to forces the trigger Modify when I edit every field.
Or a miracle [-o<
=====
I tried to block field in the page, but a I need to add a boolean variable and put it in each field.... Each field, each field, each field
http://www.mibuso.com/forum/viewtopic.php?f=32&t=46587&start=0
I apologize for my english... and this is my sad story....
I'm doing a module [Access fields] to restrict the edition of fields through a catalog of a Code, tables, fields.
That code is assigned at a user.
For example:
- The user, has roles with permission to access at pages and edit registers of tables of the Module "Sales&Customers".
- Through the new module, I specify that this user couldn't to write in the fields: Description, Search Description and Contact of the Customer table.
- And the user has a error message when wants to edit some of those fields.
The new module [Access fields] uses variables: recordref and fieldref, to make this configuration.
The calling of this configuration is in the trigger OnModify of Customer table.
Ok, well done to this point.
When I access to the Customer table directly, and want to edit one of the these configurated fields, all works fine with the validation and error message.
Buuuut when I access to the customer Card Page, like all the users, to edit the information. I just have the error message about the restriction when I close the Page. When I accept the error message, I lose the changes of ALL fields, not just about the configurated fields.
This is because the trigger Modify of a table, is called when you move of registers or to close the page.
I did other funtion of validation and tested to put the calling it on the trigger OnValidate in each field of a Customer Table, and all works fine. But then, I'll have to put this validation in trigger OnValidate of ALL the fields of tables I want to configurate the restriction fields.
If I add new fields a table and forget to put the validation, I'll lose the funcionality of this new module.
If I put the validation in the trigger Modify of a table is minimum the code to add, and keep the funcionality for new fields.
But yes, this means to modify each object table when I want to add restriction configuration for each table. ](*,)
That's why, I put my code in the codeunit 423 [Change Log Management] because there, I have all data to made the validation [TableNumber, FieldNumber] with my catalog [Module Access Fields] and user.
For this way, I don't have to modify each object table.
I need some *extra configuration*, but all works fine, because I have the development of this new module absolutely dynamic.
Buuuut the code of Change Log Setup is called in each table after de trigger OnModify....
So, I have my error message just when I'm in a edit list and edit, or when I close a Page Card.
Not inmediatly when I edit a field [like in the trigger onValidate]
So, I need a configuration or something to forces the trigger Modify when I edit every field.
Or a miracle [-o<
=====
I tried to block field in the page, but a I need to add a boolean variable and put it in each field.... Each field, each field, each field
http://www.mibuso.com/forum/viewtopic.php?f=32&t=46587&start=0
0
Comments
-
Best regards / Venlig hilsen
Johannes Sebastian
MB7-840,MB7-8410
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions