Hello every one,
I hope that you are enjoyning winter.
I have a questions.
I have created an item with "No."=ABC123 and i don't want that this number to be changed.
If i try at this item to change "No." from ABC123 to XYZ123 it alows me to change, i don't want that this to happend(even if changes all the table data where this item is used).
Any suggestions.
Thanks,
0
Answers
It works on Rename triger on table!
Thanks
you don't even need to write code in the onrename trigger...and believe, one day or another maybe you'll need to rename the record from c/al code, and at that time you'll say: "d'oh! i've to remove the error!!"
moreover, it's frustrating for the user to see errors pop up for these things. If you really don't want the user to be allowed to rename the record (why?), just make the field(s) not editable.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
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
http://www.BiloBeauty.com
http://www.autismspeaks.org
It is much more easy to change in the table check or uncheck than to comment and uncomment the code.
Thanks for your solution.