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 :
Finance | Project Operations, Human Resources, ...
Answered

How to access fields of custom formPart

(0) ShareShare
ReportReport
Posted on by 13

Hello everyone


I'm facing a problem and I have no clue how to solve it.

I have created an extension of form CustTable and add a custom form part on design that display some fields.

I need to disable some of its fields according to a standard checkbox on the custtable form.

I started to create a class and copy the event handler (modified) but i don't know how to find my form part and related fields to disable them.

Thank you in advance for your suggestions.

  • WillWU Profile Picture
    22,363 on at

    Hi CyrilDelh,

    If the fields to be disabled are bound to datasource fields, suggest to disable that fields at the data source level.

      [FormDataFieldEventHandler(formDataFieldStr(CustTable, CustTable, Checkbox), FormDataFieldEventType::Modified)]
    
        public static void Checkbox_OnModified(FormDataObject sender, FormDataFieldEventArgs e)
    
        {
    
            FormDataSource          CustTable_ds   = sender.datasource();
    
            CustTable      CustTable      = CustTable_ds.cursor();
            
            CustTable.field...
        }

  • Verified answer
    Pratik Rami Profile Picture
    225 on at

    You can do something like:

    FormStringControl con = sender.formRun().Control(sender.formRun().controlId("Name of you control");

    con.Enabled(false);

    I have assumed that your control is of string type...you can take anytype of control.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 523 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 408 Super User 2026 Season 2

#3
CU10121822-0 Profile Picture

CU10121822-0 354

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans