Skip to main content
Dynamics 365 Community / Forums / Finance forum / Dynamic controls field...
Finance forum
Unanswered

Dynamic controls fields not visible on form initialized Event Handler

editSubscribe (0) ShareShare
ReportReport
Posted on by 56

7585.pastedimage1657184622647v1.png

As shown in the screenshot I want to Visible false these fields. DlvTerm, Modedelivery and SourceCode are dynamics control it tried the following code

[FormEventHandler(formStr(DirPartyQuickCreateForm), FormEventType::Initialized)]
public static void DirPartyQuickCreateForm_OnInitialized(xFormRun sender, FormEventArgs e)
{
FormGroupControl diveTermMode = sender.design().controlName(FormControlstr(DirPartyQuickCreateForm,DynamicDetail));
diveTermMode.visible(false);
}

but nothing happens. Please give the suggestions. Thanks.

  • Komi Siabi Profile Picture
    Komi Siabi 12,239 Super User on at
    RE: Dynamic controls fields not visible on form initialized Event Handler

    Okay, use the OnActivated event on the datasource where you have these fields and revert.

  • Awais Qurni Profile Picture
    Awais Qurni 56 on at
    RE: Dynamic controls fields not visible on form initialized Event Handler

    Yes, I already Set Auto declaration property to Yes.

  • Komi Siabi Profile Picture
    Komi Siabi 12,239 Super User on at
    RE: Dynamic controls fields not visible on form initialized Event Handler

    Did you set your control Auto declaration property to Yes ?

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,045 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,570 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans