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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)
Answered

Name of active tab page

(0) ShareShare
ReportReport
Posted on by

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
    241,349 Most Valuable Professional on at

    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).

  • Martin Dráb Profile Picture
    241,349 Most Valuable Professional on at

    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.

  • Verified answer
    Martin Dráb Profile Picture
    241,349 Most Valuable Professional on at

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

    FormTabPageControl activeTabPage = tabMainTab.getActivePage();
    activeTabPage.caption();
  • Community Member Profile Picture
    on at

    Ok, thank you for the explanation.

  • Martin Dráb Profile Picture
    241,349 Most Valuable Professional on at

    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.

  • itlabnarmi_ivoruk Profile Picture
    166 on at

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

  • Martin Dráb Profile Picture
    241,349 Most Valuable Professional on at

    Anywhere in the form where you need the information (the name of the active 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans