Change Code20 to Code30 in all NAV field

sendohsendoh Member Posts: 207
Hi Guys,

We're planning to change all the fields that have 20 char to 30 char, just want to ask has anyone already did this? and what are the challenges? right now the only challenge is the limit in the byte of NAV keys. appreciate your thoughts. thanks.

Regards,
Sendoh
Sendoh
be smart before being a clever.

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    What about the variables declared with code 20 in reports or codeunits etc?
  • lvanvugtlvanvugt Member Posts: 774
    edited 2011-09-13
    If you want to be busy for a long time: go ahead. :shock:

    Now seriously: this is not something you should be wanting to do as you do not know what you are picking up. It's not just a matter of changing the length of the fields as such, but also all things related to that. Or as mohana puts it.
    What about the variables declared with code 20 in reports or codeunits etc?
    I.e. if values are copied from 'your' fields to variables you have to 'stretch' these to to prevent - potential - overflows (as 30 chars will not fit in 20 char variables).
    You have no easy way of checking what variables do relate to 'your' fields.
    I recall there is some interesting post (or a reply to a similar question) by David Singleton. You should read that. I will try to find it add the link here.
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • sendohsendoh Member Posts: 207
    I used the steps
    1. I use Virtual Table "Field" to change the Len from 20 -> 30 via code using Validate function.
    2. I export all object(txt) except the table that has an error when I try to increase the Len of the char
    3. open text file and use the REPLACE function in notepad from Code[20] to Code[30]
    4. then import it back.
    5. revisit the table that has reach the key bytes and alter it.

    am I missing something?

    I will see the result once we test it. hope this will work.

    thanks.
    Sendoh
    be smart before being a clever.
  • lvanvugtlvanvugt Member Posts: 774
    sendoh wrote:
    am I missing something?
    Yes, my warning [-X

    BTW: this is the post I mentioned above: is there a tool to change field length in all objects at once.
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • sendohsendoh Member Posts: 207
    Hi lvanvugt,
    If you want to be busy for a long time: go ahead.
    I spent 2 hours for this, thanks to "Field" VT, we prepare testing for tomorrow. will keep you posted guys. Thanks.
    Sendoh
    be smart before being a clever.
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    sendoh wrote:
    I spent 2 hours for this, thanks to "Field" VT, we prepare testing for tomorrow. will keep you posted guys. Thanks.
    You can lead a horse to water, but you cannot make it drink.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • lvanvugtlvanvugt Member Posts: 774
    You can lead a horse to water, but you cannot make it drink.
    I guess I can only agree with you, Luc.
    lvanvugt wrote:
    sendoh wrote:
    am I missing something?
    Yes, my warning [-X

    BTW: this is the post I mentioned above: is there a tool to change field length in all objects at once.
    No, there is no such tool, and Field "VT" will also not be of (full) help. [-o<
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • krikikriki Member, Moderator Posts: 9,110
    sendoh wrote:
    Hi lvanvugt,
    If you want to be busy for a long time: go ahead.
    I spent 2 hours for this, thanks to "Field" VT, we prepare testing for tomorrow. will keep you posted guys. Thanks.
    Correction: you STARTED spending 2 hours before testing.
    Before testing will be finished, you will have spent A LOT MORE TIME!
    And you won't even find all problems.
    Prepare to receive calls from users (also after a year they have been using it) saying some error has come up.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • MBergerMBerger Member Posts: 413
    I agree with Kriki, you have opened a...
    can-of-worms.jpg
  • bbrownbbrown Member Posts: 3,268
    sendoh wrote:
    Hi Guys,

    We're planning to change all the fields that have 20 char to 30 char, ...
    Regards,
    Sendoh


    Why? Do you really need 30 characters? Maybe you need to rethink your design rather then embarkign on this adventure.
    There are no bugs - only undocumented features.
  • KYDutchieKYDutchie Member Posts: 345
    Apparently you don't seem to take the advice, but I'm going to try.
    Here's a couple of issues you will run into:

    1. are you going to adjust the length of flowfilters that work on those code fields?
    2. And what are you going to do when you accidentally create an index that exceeds the maximum index length?
    3. Are you going to increase the length of code fields in the virtual tables like, User, Member of and user Role?
    4. What if you are using dlls or com objects with a fixed length input? Do you have access to that code?
    5. How will you ever upgrade? The upgrade toolkit does not account for this kind of change.

    As you can see everybody advices against your plan, I wish you good luck and please don't say you weren't warned.

    Regards,

    Willy
    Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.
  • sendohsendoh Member Posts: 207
    Guys I appreciate your reply, this is what I expect. I forgot to mentioned that this is just an R&D and just test in our test database, as per advice of our boss(I think you understand what's my point). as he always says that
    TALK DOESN'T COOK RICE
    Sendoh
    be smart before being a clever.
  • SogSog Member Posts: 1,023
    sendoh wrote:
    Guys I appreciate your reply, this is what I expect. I forgot to mentioned that this is just an R&D and just test in our test database, as per advice of our boss(I think you understand what's my point). as he always says that
    TALK DOESN'T COOK RICE

    But talk saves the cost of cooking the rice. Especially if the talk is about how you will waste the rice.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • krikikriki Member, Moderator Posts: 9,110
    Sog wrote:
    sendoh wrote:
    Guys I appreciate your reply, this is what I expect. I forgot to mentioned that this is just an R&D and just test in our test database, as per advice of our boss(I think you understand what's my point). as he always says that
    TALK DOESN'T COOK RICE

    But talk saves the cost of cooking the rice. Especially if the talk is about how you will waste the rice.
    But this is more about "How to set the kitchen on fire!"
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • kinekine Member Posts: 12,562
    And everybody forgot: you will need to go through all reports and make the columns wider, because the values will not be displayed whole... and I think this could be biggest time-eater...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • SogSog Member Posts: 1,023
    kine wrote:
    And everybody forgot: you will need to go through all reports and make the columns wider, because the values will not be displayed whole... and I think this could be biggest time-eater...
    Which is an issue nevertheless...
    I guess that's why nobody mentioned it.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • sendohsendoh Member Posts: 207
    Guys, after thorough testing we're confident now to implement this, we will deploy this to one of our new client.
    And everybody forgot: you will need to go through all reports and make the columns wider, because the values will not be displayed whole... and I think this could be biggest time-eater...
    this is true.

    anyway, thanks for the inputs and I just want to share that this is possible. Thanks :mrgreen:
    Sendoh
    be smart before being a clever.
  • kinekine Member Posts: 12,562
    Possible is everything... it is just question of time, resources and money... and it seems that you and your customer have all of that... 8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    sendoh wrote:
    Hi Guys,

    We're planning to change all the fields that have 20 char to 30 char, just want to ask has anyone already did this? and what are the challenges? right now the only challenge is the limit in the byte of NAV keys. appreciate your thoughts. thanks.

    Regards,
    Sendoh

    It is amazing how often this comes up. But I have learn't long ago that when someone wants to increase field lengths there is no point giving them good advise. So I wrote this blog some time ago ...

    http://dynamicsuser.net/blogs/singleton ... ision.aspx

    And more and more I believe what I say there, in that we need to let these juniors burn themselves so that they can learn properly.
    David Singleton
Sign In or Register to comment.