I need to create a codunit to modify the Line no. in a table where Line No. forms part of the primary key. I have been using modify but since I am chaning the primary key value it is obviously not finding it thus producing an error. What should I do to go round this problem?
0
Comments
If the field to be changed has no table relation, it is also possible to copy the record , change the fields value, insert the new record and delete the old one. That is much faster than the RENAME function, but it always has to be checked with the Developer Toolkit that the fields values are not used by other tables. In your case, for the line no., this should usually not represent a problem.
At any rate, I agree with Kowa, deleting and re-inserting is definately faster than renaming, since renaming scans the entire database to change the values that it's referecing to.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
I have used the rename function. It works but with a problem. In the table I have got some line numbers which were created using the autosplit key (i.e. records were created in between other records). For some reason these numbers are not being changed. Anyone has got any idea why this is occuring?
RIS Plus, LLC
MCP+I, MCSE NT, Navision MCT (2004,2005)