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 add static text control in class

(0) ShareShare
ReportReport
Posted on by 351

Hi all,

I have a run base batch class and i want to show static text in my dialog so that how to add?

 FormStaticTextControl  textcontrol = new FormStaticTextControl( ?)

Thanks 

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    236,289 Most Valuable Professional on at
    RE: How to add static text control in class

    Use can use addControl() of a field group to add the control. For example:

    dialogRunbase.addGroup().frameType(FormFrameType::None);
    FormBuildGroupControl currentGroup = dialogRunbase.form().design().control(dialogRunbase.curFormGroup().name());
    FormStaticTextControl staticTextControl = currentGroup.addControl(FormControlType::StaticText, 'YourControlName');

  • waytod365 Profile Picture
    351 on at
    RE: How to add static text control in class

    Sorry for the late replay sir,

    Thanks for your answer its awesome. But if we user FormBuildGroupControl we are receiving error.

    Error ;- Cannot implicitly convert from type 'FormBuildControl' to type 'FormStaticTextControl'

    After that i used FormBuildControl instated of FormBuildGroupControl.

    Correct me if I'm wrong sir.

    Thanks

  • waytod365 Profile Picture
    351 on at
    RE: How to add static text control in class

    Now, dialog is not open sir.

    I'm getting error :- Unable to cast object of type 'Dynamics.AX.Application.FormBuildGroupControl' to type 'Dynamics.AX.Application.FormGroupControl'.

  • J.Bur Profile Picture
    15 on at
    RE: How to add static text control in class

    DialogText dlgText = dialogRunbase.addText("your text");

    FormStaticTextControl  textcontrol = dlgText.control();

  • Martin Dráb Profile Picture
    236,289 Most Valuable Professional on at
    RE: How to add static text control in class

    "Build" controls (such as FormBuildGroupControl) are used when you're designing the form (before running it). Non-buiild controls (such as FormGroupControl) are used when the form is actually running.

    Therefore what code you should write depends on when you want to execute it.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,188

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 593 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans