Disable RENAME
dabel
Member Posts: 44
Is it possible to disable the RENAME process? This has become a training issue that will not stick and client just wants it disabled.
0
Comments
-
The only way I found is to put in the OnRename-trigger of each table an error.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Just put an ERROR statement in the tables' RENAME Trigger. See table 5405 "Production Order" as an example.
OnRename()
ERROR(Text001,TABLECAPTION);There are no bugs - only undocumented features.0 -
Thank you! Worked like a charm. I was trying to error this out based on certain conditions in the lines of the document, but it appeard to be just skipping that logic. This all or nothing logic will work but I wonder, does ERROR have to be the first line of code in the trigger for this to work?0
-
No, it does not. You could embed it in a condition statement.
IF [your condition] THEN
ERROR();There are no bugs - only undocumented features.0 -
What we did is add a field to the setup tables of Item, Customer, Vendor etc.
To disable RENAME but allow it if necessary without keep changing the code..
example
ON the Inventory setup table add a boolean called: "Disable Rename"
On Item Table...
OnRename()
InvtSetup.GET;
IF InvtSetup."Disable Rename" THEN
ERROR('You are not allowed to rename Items');
You can do this for the other main tables too.
Plus it simply lets you uncheck the field to reactivate rename if you need to.0 -
Savatage wrote:What we did is add a field to the setup tables of Item, Customer, Vendor etc.
To disable RENAME but allow it if necessary without keep changing the code..
example
ON the Inventory setup table add a boolean called: "Disable Rename"
On Item Table...
OnRename()
InvtSetup.GET;
IF InvtSetup."Disable Rename" THEN
ERROR('You are not allowed to rename Items');
You can do this for the other main tables too.
Plus it simply lets you uncheck the field to reactivate rename if you need to.
Interesting and useful approach.
We did something similar thru the use of a single instance codeunit. We created 2 functions (SetAllowRename & IsRenameAllowed). These can be set in various ways (let your imagination wander). One place, I've used this, is a function that allows a supervisor to re-open a finished production order to adjust consumption or output.There are no bugs - only undocumented features.0 -
Comment out the existing code and write one line of code to OnGlobalRename function in codeunit 1: "ERROR('Renaming is not allowed.');".
Enable change log and select the fields which make up the primary key of any table you want to control in the log modification column.
This method allows you to select the tables where you want to prevent renaming without having to modify the actual table itself and having to recompile. This is of course assuming that you aren't already using the change log feature to capture modifications to these tables.0 -
And it assumes your customer has the granule for the change log.canadian_bacon wrote:Comment out the existing code and write one line of code to OnGlobalRename function in codeunit 1: "ERROR('Renaming is not allowed.');".
Enable change log and select the fields which make up the primary key of any table you want to control in the log modification column.
This method allows you to select the tables where you want to prevent renaming without having to modify the actual table itself and having to recompile. This is of course assuming that you aren't already using the change log feature to capture modifications to these tables.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
kriki wrote:
And it assumes your customer has the granule for the change log.canadian_bacon wrote:Comment out the existing code and write one line of code to OnGlobalRename function in codeunit 1: "ERROR('Renaming is not allowed.');".
Enable change log and select the fields which make up the primary key of any table you want to control in the log modification column.
This method allows you to select the tables where you want to prevent renaming without having to modify the actual table itself and having to recompile. This is of course assuming that you aren't already using the change log feature to capture modifications to these tables.
Yep.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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