Options

Rename Item No.

sharjs4usharjs4u Member Posts: 3
Hi Dynamics Nav People,

can some body please help me on how to to rename item no through report or code unit. Becuase i have more than 5000 items for rename and i am tired of doing it manually. If anybody can please provide me with the objects, that will be a great help for me.

Thanks :) .

Waiting for your reply.


Regards,

Sharjs

Comments

  • Options
    garakgarak Member Posts: 3,263
    Did you check the function rename? ;-)
    Do you make it right, it works too!
  • Options
    AsallaiAsallai Member Posts: 141
    hi, i don't know exactly, but why do you want? :o
    It is very dangerous, please rethinking again. if you change directly the Item No (primary key) it could be occurs problem at several other places.
    Or this is only at the beginning of the Implementation phase?

    but if it is yes, the old method is that you have to copy the record to a different record variable of Item with the New Item No, delete the old one and Insert the new one.
    But if you are using 4 or 5, there is a FINDSET to use, in this case not necessary the delete and insert method...
    But :!: please think what is happening after this changes.
  • Options
    bbrownbbrown Member Posts: 3,268
    Asallai wrote:
    hi, i don't know exactly, but why do you want? :o
    It is very dangerous, please rethinking again. if you change directly the Item No (primary key) it could be occurs problem at several other places.
    Or this is only at the beginning of the Implementation phase?

    but if it is yes, the old method is that you have to copy the record to a different record variable of Item with the New Item No, delete the old one and Insert the new one.
    But if you are using 4 or 5, there is a FINDSET to use, in this case not necessary the delete and insert method...
    But :!: please think what is happening after this changes.

    This is the approach that will get you in trouble, as the related tables will not be updated. Using the RENAME function will also update related tables. So even if you have transactions against these items the data will be updated properly. This of course assumes that when any modifications were done, proper table relations were defined.
    There are no bugs - only undocumented features.
  • Options
    AsallaiAsallai Member Posts: 141
    This is the approach that will get you in trouble, as the related tables will not be updated. Using the RENAME function will also update related tables. So even if you have transactions against these items the data will be updated properly. This of course assumes that when any modifications were done, proper table relations were defined.

    You are right, thank you. :-#
  • Options
    sharjs4usharjs4u Member Posts: 3
    Thanks every one. The only problem is i am not good in coding and i dont know how to write them. So If some body can please help me on writting the code or send me the object that will be a great help. Right now i am doing renaming of item one by one, and its taking lot of time.

    Thanks once agian.

    Regards,

    Sharjs
  • Options
    ssinglassingla Member Posts: 2,973
    Contact your partner in case you work for client else your senior for support. Working with little or no knowledge is dangerous.
    CA Sandeep Singla
    http://ssdynamics.co.in
Sign In or Register to comment.