BigJohn
28th January 2003, 20:56
Hi,
Is it a good idea to change a field which is part of the Primary
Key?
If not, why?
Thx in advance.
Regs,
BJ
Paul P
29th January 2003, 03:31
Dear BJ,
It's not so much a question of goodness of the idea as a question of the necessity. People changed many fields which are primary key, e.g. when they want a longer item code or longer lot code. The questions to ask are always, "Do you really need to change it?" Are there alternatives? Which parts of BaanERP operations are affected? Are you prepared to look detailed enough into every part affected by the change and make sure it will be alright there? What are the screen changes involved? What reports may have to be changed? In what way may it affect your customisations? What customisations need to be re-done to accomodate the change? How many hours of work would it take to do all the related works (this is an important question if you're on a live system)? What disruptions may the users feel? What to do when things go wrong? And probably many other questions.
If you can comfortably answer all the questions above, then probably it makes sense to make such change. Pls take a look at Change domain length (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=8552) thread on other people's experiences on this matter. Have a great day!
Rgds,
Paul
OmeLuuk
29th January 2003, 13:27
I assume the q us for something else:
like in a sales order line:
orno and pono are part of the primary index.
You can change the value of pono with ttaad4100 but in general it is not a good thing to do, because of existing references that may not allow this. If you change a pono on a salesorderline your receiptline with the same pono should have the same change to avoid loss of referential integrity. Sometimes these references will not allow you to change parts of the key, but sometimes they will with possible errors later on.
So in general: if you can change the indexparts with the standard sessions (other than GTM and/or correction programs), it is save to do so.
You can to some extend copy a salesorderline to another line and delete the original line to "change" the pono, but this is only possible if the order status can allow you to do so.
You can do an inventory transfer to change the cwar part of an inventory record etc...
If you are forced to do it in GTM (and GTM does allow you to do so) it may be save, but better not trust it. If GTM does not allow you to do so, don't try to do it.