Options

Field No in Item Card

bekiobekio Member Posts: 204
edited 2010-12-14 in NAV Three Tier
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,

Answers

  • Options
    manishgoyalmanishgoyal Member Posts: 52
    you have to create an Error message on on Modify Trigger of Item Table.
    Manish Goyal
  • Options
    bekiobekio Member Posts: 204
    It does not works, i have tired it.

    It works on Rename triger on table!

    Thanks
  • Options
    BeliasBelias Member Posts: 2,998
    what about editable property of the field in the table?
    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.
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Options
    ShedmanShedman Member Posts: 194
    Belias wrote:
    what about editable property of the field in the table?
    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.
    Only problem is when you manually create the Item Nos. ...
  • Options
    BeliasBelias Member Posts: 2,998
    Shedman wrote:
    Only problem is when you manually create the Item Nos. ...
    ops...sorry for that, what was i thinking about? :mrgreen: :oops:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Options
    SavatageSavatage Member Posts: 7,142
    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
  • Options
    bekiobekio Member Posts: 204
    Thanks a lot of, i have mentioned that solutions.

    It is much more easy to change in the table check or uncheck than to comment and uncomment the code.

    Thanks for your solution.
Sign In or Register to comment.