Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

How to change text of FormBuildControl in x++?

(0) ShareShare
ReportReport
Posted on by 159

Hi experts,

I have a requirement of creating an inquiry form which shows no of items and no of warehouses against those items which are purchased. I need to add dynamicControl for warehouses because the no of warehouse changes with legal entities. I need to display how many items are being purchased from these warehouses. For example: Item: 001 is purchased from warehouse no: WH-01 3 times.  

So, I have added multiple dynamic formBuildStringControl. I now want to change the text of these dynamic controls on modify of a control but it's not working on front-end. Can you please suggest me anything? Your suggestions would be a great help to me. 

Thanks in advance.

Here is my code of modified on a control textbox:

pastedimage1683013832054v1.png


Here is my code of dynamically adding controls to a grid:
pastedimage1683013962653v2.png


Here is my form design:

pastedimage1683013996348v3.png


Here is my form init method where I am calling the addDynamicsControl method where controls are dynamically added.
pastedimage1683014099814v4.png


My addDynamicControls is working perfectly but controls.text is not reflecting in front-end. I did debug my code and I found out that the controls.text stores the text however, it is not reflecting in front-end. 

Please ask any further information you need.

  • Arif Hussain Profile Picture
    Arif Hussain 159 on at
    RE: How to change text of FormBuildControl in x++?

    Yes Bharani Preetham Peraka ,

    I have gone through it, I am getting the buffer as well and the text is reflecting in backend using debugging but it is not reflecting in frontend.

  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,587 Super User 2024 Season 1 on at
    RE: How to change text of FormBuildControl in x++?

    Have you checked this?

    community.dynamics.com/.../524007

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: How to change text of FormBuildControl in x++?

    Please check this old thread to go through challenges in creating form controls dynamically at runtime.

    community.dynamics.com/.../dynamically-add-fields-to-a-from-grid-control

    As Martin mentioned, reports will be best fit, if still you need form then you can explore usage of temporary tables in this case.

  • Martin Dráb Profile Picture
    Martin Dráb 230,842 Most Valuable Professional on at
    RE: How to change text of FormBuildControl in x++?

    You'll be a better off if you create a report rather than a form. Both SSRS and Power BI have a matrix control for this purpose.

  • Arif Hussain Profile Picture
    Arif Hussain 159 on at
    RE: How to change text of FormBuildControl in x++?

    Hi sir (Mohit Rampal , goshoom ),

    Can you please help me.

  • Arif Hussain Profile Picture
    Arif Hussain 159 on at
    RE: How to change text of FormBuildControl in x++?

    Hi Mohit Rampal ,

    I have debugged the code and as you can see in the below picture, the text is working fine in the backend and I am also getting the buffer.

    pastedimage1683023345028v1.png

  • ArifHussain Profile Picture
    ArifHussain 10 on at
    RE: How to change text of FormBuildControl in x++?

    Yes, I am getting the buffer.

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: How to change text of FormBuildControl in x++?

    Hi Arif, Are you getting buffer in controls (Line# 84).

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans