Unique ID Implementation

PhennoPhenno Member Posts: 630
I read a doc on partner site called "Unique ID Implementation" and have som e doubts about it.


Is this feature implemented in SP3 or it existed before?
I tried it with SP2 and it didn't work so, I suppose I'll have to wait SP3 executables for our country (group 3)

Does this feature automatically applies next ID for objects and fields in tables?

Comments

  • AlbertvhAlbertvh Member Posts: 516
    Hi Phenno,

    As far as I can make out it is not available in the previous versions < SP3


    Problem Statement
    When you create an add-on solution, you must make sure that the new objects you create are given unique IDs (UIDs) from the range assigned to the add-on in question. This is done by using the appropriate license. There will be no problem as long as only one add-on solution is included in the developer’s license.

    However, if the developer’s license includes permission to create more than one add-on solution, it gets more complicated. In this case, the UIDs must be added manually during development instead of allowing them to be added automatically.

    One consequence of not manually applying the UIDs could be that two separate add-on solutions are given the same range of IDs. This will generate merge errors when you try to implement the two add-on solutions in the same Microsoft Business Solutions-Navision database.

    Manually setting the UIDs so that they comply with the appropriate add-on UID range is both a tedious and an error-prone task.
    Cause
    The Microsoft Business Solutions-Navision platform is not able to identify more than one range of unique IDs in a license.
    Resolution
    A function (with a fixed, predefined ID) can be added to codeunit 1. This function returns the base UID for the application, much like the SetGlobalLanguage function does for the application language. The function is called whenever Microsoft Business Solutions-Navision needs to find the base UID for the application. Starting from that base UID, the function finds the next available UID, which is then used for the new function, text constant etc in question.

    Notation:
    PROCEDURE GetUidOffset@212122() : Integer;

    Example:
    While creating an add-on solution, a developer at a Microsoft Certified Partner can change codeunit 1 (and restart Microsoft Business Solutions-Navision or re-open the company they’re working in – because of codeunit 1’s Single Instance-like behavior) to reflect the UID range that was assigned to the add-on in question.

    BEGIN
    Exit(Insert add-on solution ID here);
    END;

    When the partner adds a new text constant, function etc., the C/AL Editor will start at the inserted add-on solution ID and find the next available number.
    The procedure for creating an add-on solution and adding UIDs is:
    1. Open Codeunit 1 and add PROCEDURE GetUidOffset@212122() : Integer;. This ensures that you use the appropriate add-on solution ID.
    2. Save and compile.
    3. Open Company.
    4. Start developing ‘Add-on Solution 1’.
    5. Save and compile ‘Add-on Solution 1’.
    6. Change Codeunit 1 – delete PROCEDURE GetUidOffset@212122() : Integer;.
    7. Save and compile Codeunit 1.
    You must repeat these steps for each separate Add-on UID range you work with.
    Known Issues
    · After this workaround has been implemented in codeunit 1, you must open a company in Microsoft Business Solutions-Navision before you open the C/AL designer. This is due to the fact that codeunit 1 is not called before you open a company.
    · If this workaround is not implemented when you are developing an add-on solution, the UIDs will be assigned according to the old implementation and might cause problems when you merge more than one add-on solution into a Microsoft Business Solutions-Navision database.


    Regards
    Albert
  • PhennoPhenno Member Posts: 630
    Yes, It seems that is right.

    Does anybody knows, what functions this feature provides, exactly?
  • kinekine Member Posts: 12,562
    Yes, this modification is part of the SP3. The description of this is part of this module. You can download it on the SP3 download page.

    All what it is doing is, that partner can change the "ID's base" which is used when developing some functionality. In older versions the ID's were starting from no. 1000000000. Because you need for each addon use another ID's to precede conflicts when merging more addons into one solution, this functions allows partners to change this base. Without that functionality you needed to change the ID's on all variables, functions and controls manually or use some renumbering tool.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ara3nara3n Member Posts: 9,258
    Yes this caused me a lot of trouble when merging multiple addons.
    I hope all the addon people update their objects for future releases. If they don't the developers doing the merging will have the same problem still.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • PhennoPhenno Member Posts: 630
    Ok, thx people.
    Our SP3 (for group 3) is still not availible, unfortunatly...
Sign In or Register to comment.