Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Init the value of a specific field in a grid

(0) ShareShare
ReportReport
Posted on by 58

Hello,
For a time, I was stuck on this problem.
I add a formComboBoxControl to a grid, but I need to filter the Enum values, so I use the class "SysFormEnumComboBox" to complete the job, and everything works well. The issue is that when I use the "SysFormEnumComboBox," the control must not be bound to a datasource field or method, thus when I open the form again, the previously saved values cannot be displayed on the screen since I can't discover where to put the code to fill the data in the control.

pastedimage1667213604790v1.png

I select the value (exp: Pourcentage)

pastedimage1667213769549v2.png

when I reload the page, I can't insert the data, so no data displayed

pastedimage1667223304878v3.png

  • TNGrizzly Profile Picture
    TNGrizzly 58 on at
    RE: Init the value of a specific field in a grid

    Thank you, Girish this solved my problem

  • GirishS Profile Picture
    GirishS 27,832 Super User 2024 Season 1 on at
    RE: Init the value of a specific field in a grid

    If you want to filter the enum values - You can add the code in form control enter method to filter values.

    Add a datasource bound control - On the control - override the enter method and add the below code.

    public void enter()
    {
        super(); 
        this.delete(enum2str(YourEnumName::Other));
    }

    Also you can filter enum values based on the condition also. This enter method will be called every time you click on combo box control.

    Thanks,

    Girish S.

  • TNGrizzly Profile Picture
    TNGrizzly 58 on at
    RE: Init the value of a specific field in a grid

    Hello GirishS 

    "I add a formComboBoxControl to a grid, but I need to filter the Enum values"

  • GirishS Profile Picture
    GirishS 27,832 Super User 2024 Season 1 on at
    RE: Init the value of a specific field in a grid D365Fo

    Hi TNGrizzly,

    If you want to save the field value it must be bound to datasource. So that selected value will be stored in the table.

    So next time when you open the form it will fetch data from the table and display.

    If you are using a control which is not bound to datasource - it is impossible to save the control values.

    What is the issue in creating a datasource bound control? Do you want to filter the enum values?

    Thanks,

    Girish S.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans