You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a lot of apps and already hitting limits of our ranges. We don't want to request new object ranges because then you also have to "force" all customers to generate new BC licenses.
So we need a way to "defragment" used numbers in a range. Ideally, a single number from a range should be used by as many object types as possible - so if you have range numbers 70123456 and 70123457 you don't want to situation where you have the table 70123456 and the page 70123457 while the page 70123456 does not exist (for example, the page 70123456 was freed up by deleting an obsoleted object).
This defragmentation function should also be able to renumber objects while not causing breaking changes. It also could suggest if some old object is obsoleted and can be freed up.
The algorithm:
(Optional) Remove obsoleted objects. Tables and table fields cannot be moved unless they are not in previous app (AppSourceCop.json setting).
Move all objects and fields that are not in previous app version (AppSourceCop.json setting) to the beginning of app object range. Keep track of objects/fields that cannot be moved.
For example, internal codeunits can always be renumbered (care needed in case of Codeunit.Run(...)). Internal temporary tables also can be moved.
Look for objects/fields* that can be moved to free spots next to objects/fields that cannot be moved. Don't bother moving if they are already next** to an object/field that cannot be moved.
* The fields could be used in TransferFields so this needs care. For example, Sales Header and Sales Invoice Header tableextension could use different field numbers. The function should leave the decision to the programmer.
** "Next to" means sharing a number with another object or field that cannot be moved.
The function should only remove objected objects that were already obsolete in the previous app.
Example problem - need to move 1 range number to another app (immovable objects/number are bolded):
App Range Number
Used by Table
Used by Field
Used by Page
Used by Codeunit
...
70123456
X
X
X (Obsoleted)
(Deleted)
70123457
(Removed temporary table before a new release)
(Gap for some reason)
X
X
70123458
X (Internal Temporary)
X
(Added then deleted)
X (Internal)
70123459
(Free)
X (New)
X (New)
First phase - remove obsoleted objects:
App Range Number
Used by Table
Used by Field
Used by Page
Used by Codeunit
...
70123456
X
X
70123457
X
X
70123458
X (Internal Temporary)
X
X (Internal)
70123459
X (New)
X (New)
Second phase - move objects and fields to the beginning of app object range.
App Range Number
Used by Table
Used by Field
Used by Page
Used by Codeunit
...
70123456
X
X
X (New)
X (Internal)
70123457
X (Internal Temporary)
X (New)
X
X
70123458
X
70123459 (is now free for the taking)
Third phase - move objects and fields next to other immovable objects or fields to free up more numbers. Nothing to do in this case.
Internally, Used by Field should be split into multiple columns one for each table/tableextension.
In our case, there are around 500 objects split into 6 apps and we need to free up 2 objects this time.
Subgoals:
A window/view that shows numbers and their "users" in a table similar to the tables above. This alone is would be very helpful.
This table could be color-coded, e.g. instead of X like in my examples above, have a black square for immovable object, blue square for movable object, a green square for objects that are not in previous version on an app, a yellow square for objects that are obsolete and immovable, a red square for objects that are obsoleted in previous version of the app and can be removed.
There should be a way to filter out table lines that only have immovable objects (yellow and black squares).
Then the problem is essentially moving blue and green squares to empty spaces or over red squares.
A function that removes obsolete objects and enum values. Could be in some different VS Code extension (e.g AZ Dev Tools).
A function that moves all movable objects to the beginning of app object range.
A function that moves all movable objects that are not next to immovable objects next to immovable objects to free up some numbers.
A function that combines all three phases in one.
Thanks.
The text was updated successfully, but these errors were encountered:
ernestasjuska
changed the title
A function for "defragmenting" free object/field numbers
A function for "defragmenting" free object/field/enum numbers
Oct 29, 2024
Hi,
We have a lot of apps and already hitting limits of our ranges. We don't want to request new object ranges because then you also have to "force" all customers to generate new BC licenses.
So we need a way to "defragment" used numbers in a range. Ideally, a single number from a range should be used by as many object types as possible - so if you have range numbers 70123456 and 70123457 you don't want to situation where you have the table 70123456 and the page 70123457 while the page 70123456 does not exist (for example, the page 70123456 was freed up by deleting an obsoleted object).
This defragmentation function should also be able to renumber objects while not causing breaking changes. It also could suggest if some old object is obsoleted and can be freed up.
The algorithm:
For example, internal codeunits can always be renumbered (care needed in case of Codeunit.Run(...)). Internal temporary tables also can be moved.
Example problem - need to move 1 range number to another app (immovable objects/number are bolded):
First phase - remove obsoleted objects:
Second phase - move objects and fields to the beginning of app object range.
Third phase - move objects and fields next to other immovable objects or fields to free up more numbers. Nothing to do in this case.
In our case, there are around 500 objects split into 6 apps and we need to free up 2 objects this time.
Subgoals:
This table could be color-coded, e.g. instead of X like in my examples above, have a black square for immovable object, blue square for movable object, a green square for objects that are not in previous version on an app, a yellow square for objects that are obsolete and immovable, a red square for objects that are obsoleted in previous version of the app and can be removed.
There should be a way to filter out table lines that only have immovable objects (yellow and black squares).
Then the problem is essentially moving blue and green squares to empty spaces or over red squares.
Thanks.
The text was updated successfully, but these errors were encountered: