I want to stop users from renaming records

mpmauricempmaurice Member Posts: 6
I have a customer table and I want to stop users from renaming the customer record

Comments

  • SogSog Member Posts: 1,023
    add this code in onrename:
    error('you may not rename a customer, yes you may not, you know why, because it's just a code, a primary key so the system knows what customer is connected to which transactions. You want to rename this customer? Try the name field you silly user');
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • rhpntrhpnt Member Posts: 688
    The renaming/changing of primary key values in itself is not a bad thing and should not be deactivated by default. There is a reason why it can be done "out of the box". But often users misunderstand or simply don't know the meaning of such doing and the sometimes catastrophic consequences it can lead to. My advice would be to educate users and explain the consequences.
  • ssinglassingla Member Posts: 2,973
    Or you can customize to have some additional security using User Setup table. Add a boolean field "Auth. Customer Rename" (you can choose your field name) in the table. Give permission to authorized/educated/intellegent users and in Customer Table "OnRename" trigger check the boolean value.
    CA Sandeep Singla
    http://ssdynamics.co.in
  • SavatageSavatage Member Posts: 7,142
    We use a setup table Boolean too:
    OnRename()
    SalesSetup.GET;
    IF SalesSetup."Block Rename of Customer" THEN
    ERROR('You are not allowed to rename Customers');
    
    We have added similar code to Vendor, Customer, Item tables.

    We saw it early in our Nav experience where new users were typing over the field expecting it to move to the record the wanted but forgetting to hit the Magifying Glass (Find). Before you knew it they were renaming. As a double check we made all fields not editable and made a new tab at the end of the form called add/change where edits could be made to customers, vendors, items.
  • slmaluwaslmaluwa Member Posts: 366
    We also had bad experiece at the first few months installation four years back and handled issue using similar idea.

    In our case, we simply "DISABLED" the code or No. field and enabled only for INSERT. (With the exception of few super users setup in User Setup table).
    "A bove maiore discit arare minor"-"From the old ox, the young one learns to plow."
  • VjekoVjeko Member Posts: 55
    Don't underestimate the power of OnDatabaseRename trigger in Codeunit 1 either. You can control any rename in any table through that trigger, and it's synchronous (unlike OnGlobalRename).
    (Co-)author of "Implementing Microsoft Dynamics NAV 2009"
    http://vjeko.com/
Sign In or Register to comment.