Set Control ID Range for forms

Joe_MathisJoe_Mathis Member Posts: 173
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?

Comments

  • TvisTvis Member Posts: 70
    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 Member Posts: 12,562
    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 Member Posts: 8,304
    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_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    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.

    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.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • DenSterDenSter Member Posts: 8,304
    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 Member Posts: 173
    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 Member, Moderator Posts: 9,094
    [Topic moved from Navision forum to Navision Tips & Tricks forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • ravishahravishah Member Posts: 13
    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...
  • barandenizbarandeniz Member Posts: 44
    Yeah, i wonder same thing also. Is there a way to reassign Contrl IDs which are added by Developer? We developed an addon, but when we are trying to merge with NAV 2017 nearly all the control IDs are conflicting with the new Fields which are added by NAV 2017. After the merge process we can not import new objects to system. At least is there anyway to get confilicted onject list from a powershell cmdt ?
Sign In or Register to comment.