Rename Item Base Unit of Measurement

Hi, does anybody know, why it is not possible to rename an “Item Unit of Measur”, that is the Item.“Base Unit of Measure”, if there are “Item Ledger Entries” that are open for that Item[?] Cheers Daniel

And has anyone written code to allow changing base unit of measure when there are entries? (Sorry for hijacking your thread [:I])

quote:

Hi, does anybody know, why it is not possible to rename an “Item Unit of Measur”, that is the Item.“Base Unit of Measure”, if there are “Item Ledger Entries” that are open for that Item[?] Cheers Daniel
Originally posted by zimiwings - 2005 Nov 13 : 14:57:38

I can’t check it right now, but I believe you can rename the Unit of Measure as you can with any other code. You can’t change an Item Base Unit of Measure when there are posted entries because the quantities in the ledger entries would need to be converted. Anna

Hi Anna, yes, to change the quantities, one would need to write some code (and as Lars, I would be interested in that code). But if I only want to change the name of the unit, I don’t see the need for converting the ledger entries, but still an error message pops up. Daniel

quote:

Hi Anna, yes, to change the quantities, one would need to write some code (and as Lars, I would be interested in that code). But if I only want to change the name of the unit, I don’t see the need for converting the ledger entries, but still an error message pops up. Daniel
Originally posted by zimiwings - 2005 Nov 14 : 05:56:14

Hi, Daniel To rename the unit you must rename it in table 204 Unit of Measure, not in table 5404 Item Unit of Measure; it will take ages to change all the relations, but it works. Anna

Well, that is not possible, because both item units allready exist as Units (T204), and they both are in use will be used for different items. I was just wondering, why MBS has disallowed to Rename the Item units of Measure, when there are open Ledger entries. Thanx Daniel

If they both exist in the Unit of Measure Table (204) then you are NOT renaming the one in the Item Unit of Measure, you are actually changing it to a new value. Example You have Units of Measure: KG - Kilogram (Qty per. = 1000) KGS - Kilograms (Qty per. = 100) You will not be able to rename an Item Unit of Measure from KG to KGS because that would actually change the conversion. The bottom line is that you are not renaming a Unit of Measure by changing this table, you are changing the Unit of Measure which is not allowed with open ledger entries for obvious reasons.

How about deleting one unit of measure. and renaming the second to the first one. Looks like you are trying to merge two unit of measures. The problem you’ll run into is any table that has the Unit of measure in Primary key, and the rename will collide. The renaming will show you those collisions and you can write a routine to delete on of the records for the collisions.

Chris, no, this is purely cosmetic. I have two units of measure, say “1” and “PK”. in one item, the Base unit of Measure is “1”, and now my client wants to change it to “PK”. I am renaming the record in table 5404, because the OnRename Trigger gets fired, and I do not want to do anything with the “Qty per.” field at all. Ahmed, thank you, but this would not work, since you can not change the base unit of measure, when there are open Item ledger entries Daniel

The system doesn’t know it’s cosmetic. Yes, you are firing the OnRename Trigger, this is because you are changing the primary key. Effectively, you are changing the Base Unit of Measure on the Item from 1 to PK. This is not allowed under the rules on the Item Table. The code doesn’t check to see if the Qty. Per Unit of Measure changes. You can always temporarily remove the code on the Item Table but you would need to make sure that the two Units of measure have the same qty. per