Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)
Answered

Name of active tab page

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

How can I get the name of  a TabPage active.

if i in the TabPage = 2 the name is Page 2, TabPage = 4, name is Page 4.

I have this

index = tabMainTab.tab(); this is  #2 Name: Page2

and in the caption  all the time give me Page1.

I have this:

 FormTabPageControl FTPC ;

;

super();

index = tabMainTab.tab() // 2

 name = FTPC.caption(); // Page 2 but all the time is Page 1

Somebody know how i can do that?

Thanks in avance.

*This post is locked for comments

  • Martin Dráb Profile Picture
    Martin Dráb 230,354 Most Valuable Professional on at
    RE: Name of active tab page

    Anywhere in the form where you need the information (the name of the active tab page).

  • itlabnarmi_ivoruk Profile Picture
    itlabnarmi_ivoruk 131 on at
    RE: Name of active tab page

    Hi, where to write above two line of code, I mean on which method override ?

  • Martin Dráb Profile Picture
    Martin Dráb 230,354 Most Valuable Professional on at
    RE: Name of active tab page

    If your question is now answered, please close the thread by marking the verified answer(s). It will make clear that the thread doesn't need attention anymore, and people with the same question will easily locate the answer.

    Notice "Did this answer your question?" beside each reply.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Name of active tab page

    Ok, thank you for the explanation.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,354 Most Valuable Professional on at
    RE: Name of active tab page

    You can get the active tab page by calling tabMainTab.getActivePage():

    FormTabPageControl activeTabPage = tabMainTab.getActivePage();
    activeTabPage.caption();
  • Martin Dráb Profile Picture
    Martin Dráb 230,354 Most Valuable Professional on at
    RE: Name of active tab page

    I don't believe that your code works. You never set the value of FTPC variable, therefore FTPC.caption() should fail, because you're trying to call a method on a null reference.

  • Martin Dráb Profile Picture
    Martin Dráb 230,354 Most Valuable Professional on at
    RE: Name of active tab page

    I took the liberty to change your title from FormTabControl to a more descriptive Name of active tab page. I also changed the category from Other to Development / Customization / SDK and replaced the sentence you used as a tag (Name of TabPage active.) with something more suitable for categorization (tab page).

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,622 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,354 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans