web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to get the control ID of TabPage

(0) ShareShare
ReportReport
Posted on by 371

Hi All,

I have created the extension of form "EntAssetObjectType" and simply created a Tab page, than i created a COC of the Form init method what i want that before calling the NEXT keyword i want to know the Control ID of the custom Tab page.

I Am able to get the Control ID after the next call but is there any way that i can get the control id before the NEXT call.

Thanks.

I have the same question (0)
  • Suggested answer
    vinaytak Profile Picture
    371 on at
    RE: How to get the control ID of TabPage

    Thanks a lot @Will WU And @Nikolaos Mäenpää.. i am able to achieve using the event handler "OnInitializing event handler". there i initialized the control and gets the control ID and passed to other other method where i required .

    Also one found the reference which help me :-

    community.dynamics.com/.../1092980

    Thanks all for your suggestion

  • Martin Dráb Profile Picture
    235,968 Most Valuable Professional on at
    RE: How to get the control ID of TabPage

    Please always use Insert > Insert Code (in the rich-formatting view) to paste source code. Like this:

    [FormEventHandler(formStr(EntAssetObjectType), FormEventType::Initialized)]
    public static void EntAssetObjectType_OnInitialized(xFormRun sender, FormEventArgs e)
    {
    	FormRun formrun = sender as FormRun;
    	FormControl externalId = sender.control(sender.controlId('TabPageChecklist'));
    	int test = externalId.id();    //formrun.design().control(formrun.controlId(formControlStr(EntAssetObjectType, TabPageChecklist))).id();
    	
    	// sysListPanel_Variable = AvaSysListPanel_EntAssetObjectTypeVariable::newForm(this, this.controlId(formControlStr(EntAssetObjectType, TabPageChecklist)));
    	// Custom class AvaSysListPanel_EntAssetObjectTypeVariable passing form run and parent id
    	AvaSysListPanel_EntAssetObjectTypeVariable::newForm(sender, test));
    	
    	// but getting this button error on the method InIT()
    	// not getting the add button its always show the null
    	sysListPanel_Variable.init();
    }

    Unfortunately I don't understand your comments, such as "not getting the add button its always show the null". Could you be more specific, please?

  • Verified answer
    WillWU Profile Picture
    22,361 on at
    RE: How to get the control ID of TabPage

    Hi Vinay,

    Please try the OnInitializing event handler.

  • vinaytak Profile Picture
    371 on at
    RE: How to get the control ID of TabPage

    [FormEventHandler(formStr(EntAssetObjectType), FormEventType::Initialized)]

       public static void EntAssetObjectType_OnInitialized(xFormRun sender, FormEventArgs e)

       {

           FormRun formrun = sender as FormRun;

           FormControl externalId = sender.control(sender.controlId('TabPageChecklist'));

           int test = externalId.id();    //formrun.design().control(formrun.controlId(formControlStr(EntAssetObjectType, TabPageChecklist))).id();

          // sysListPanel_Variable = AvaSysListPanel_EntAssetObjectTypeVariable::newForm(this, this.controlId(formControlStr(EntAssetObjectType, TabPageChecklist)));

        // Custom class AvaSysListPanel_EntAssetObjectTypeVariable passing form run and parent id

            AvaSysListPanel_EntAssetObjectTypeVariable::newForm(sender, test));

    // but getting this button error on the method InIT()

    // not getting the add button its always show the null

         sysListPanel_Variable.init();

       }

  • vinaytak Profile Picture
    371 on at
    RE: How to get the control ID of TabPage

    Yes Nikolaos i want to use the List panel on the form extension please provide any reference on it

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: How to get the control ID of TabPage

    The tab page is initialized in the init method. The id doesn't exist before it. But I guess your actual question is "how to initialize a ListPanel in a form extension", right?

  • WillWU Profile Picture
    22,361 on at
    RE: How to get the control ID of TabPage

    Hi Vinay,

    Please provide the codes and the error message if possible.

  • vinaytak Profile Picture
    371 on at
    RE: How to get the control ID of TabPage

    thank you for the Reply [tag:WillWU].. I am able to do this getting the ControlID but i am creating the Syslistpanel. I created copy class as per the standard and passing the control ID of the custom.. but on the INIT method of the syslistpanel getting the object refernce null error.

  • WillWU Profile Picture
    22,361 on at
    RE: How to get the control ID of TabPage

    Moved to D365FO forum.

  • WillWU Profile Picture
    22,361 on at
    RE: How to get the control ID of TabPage

    Hi Vinay Tak,

    Do you consider using event handler?

    6724.pastedimage1600740609868v1.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 878 User Group Leader

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 681 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 496 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans