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

Notifications

Announcements

No record found.

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)
  • WillWU Profile Picture
    22,361 on at

    Hi Vinay Tak,

    Do you consider using event handler?

    6724.pastedimage1600740609868v1.png

  • WillWU Profile Picture
    22,361 on at

    Moved to D365FO forum.

  • vinaytak Profile Picture
    371 on at

    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

    Hi Vinay,

    Please provide the codes and the error message if possible.

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    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?

  • vinaytak Profile Picture
    371 on at

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

  • vinaytak Profile Picture
    371 on at

    [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();

       }

  • Verified answer
    WillWU Profile Picture
    22,361 on at

    Hi Vinay,

    Please try the OnInitializing event handler.

  • Martin Dráb Profile Picture
    237,959 Most Valuable Professional on at

    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?

  • Suggested answer
    vinaytak Profile Picture
    371 on at

    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

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 592 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 305 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans