Set Control ID Range for forms

Joe_MathisJoe_Mathis Posts: 173Member
edited 2012-07-03 in NAV Tips & Tricks
If you add a textbox, the ID for that control starts at 1 billion.

Is there a way to change this to a different number range?

I just want to be able to identify my changes by maybe going another 50000 higher or something. So not a big deal if it can't be done programatically. Just curious...

From what I see this only applies to forms (I know, request ones too. :mrgreen: )

Any ideas?


  • TvisTvis Posts: 70Member
    If you go into properties on your Textbox --> the first of the properties is ID --> In the value field besides ID you should be able to change the number to what you like.
  • kinekine Posts: 12,553Member
    Since SP3 there is function UIDOffset() in CU1 which will return the base ID for all new controls, variables and functions created by the developer. You can read more about that in SP3 documentation related to this. You can change the function to return another ID for each developer or based on some setup (based on which module you are changing etc.).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • DenSterDenSter Posts: 8,051Member
    I checked a standard 5.0 database and a standard SP3 database it's not there. Is that a function you can add and make that work?
  • Luc_Van_DyckLuc_Van_Dyck WilrijkPosts: 3,624Member, Moderator, Administrator
    It's explained in the "Unique IDs for ISVs" white paper:
    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.

    The Microsoft Business Solutions-Navision platform is not able to identify more than one range of unique IDs in a license.

    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.

    PROCEDURE GetUidOffset@212122() : Integer;

    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.

    Exit(Insert add-on solution ID here);

    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.
    No support using PM or e-mail - Please use this forum. || Search is your friend
    NAV TechDays 2016: 17 & 18 November 2016, Antwerp (Belgium)
  • DenSterDenSter Posts: 8,051Member
    I knew it was possible, the vertical team at the company I used to work for did that. That is a really handy little tool if you're in the add-on business, makes developing a lot easier.
  • Joe_MathisJoe_Mathis Posts: 173Member
    Well that's the answer...

    I don't think we are quite to the ISV stage yet, but it's good to know it's do-able.

    Thank you for all your responses.
  • krikikriki Posts: 7,917Member, Moderator
    [Topic moved from Navision forum to Navision Tips & Tricks forum]
    Regards,Alain Krikilion
    Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title! || Read Forum Rules before making a posting

  • ravishahravishah Posts: 12Member
    Dear Sir,

    Thank You So much for Sharing Such a Helpful Tips.

    Sir, I want to Know Is there any way to Reassign Control ID?

    If I Want All Forms Control Id to Convert in Our Series Is there any Way?

    Please Guide...
Sign In or Register to comment.