Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

mandatory field in DirPartyQuickCreateForm

Posted on by 270

Hi!

I have to make a field from custTable (a field that was added in customization) to be mandatory when the user wants to create a new customer. This is in the "DirPartyQuickCreateForm" form. This field is already mandatory when we edit a customer, but for a new one it doesnt show up in the form.

Has anybody done this before??

Thanks!!

Jorge

  • Suggested answer
    mandatory field in DirPartyQuickCreateForm
    We can try below in form init event handler.It should work.
     
    [FormEventHandler(formStr(DirPartyQuickCreateForm), FormEventType::Initialized)]
    public static void initializedFormEventHandler(xFormRun _sender, FormEventArgs _e)
    {
            FormRun             formRun = _sender as FormRun;
            FormDataSource      dirPartyEntityDataSource;
            dirPartyEntityDataSource    = formRun.dataSource(formDataSourceStr(DirPartyQuickCreateForm, DirPartyEntity)) as FormDataSource;
            if (dirPartyEntityDataSource.table() == tablenum(CustTable))
            {
                dirPartyEntityDataSource.object(fieldnum(CustTable, #RequiredFieldName)).mandatory(true);
            }
    }
     
  • Batuque Profile Picture
    Batuque 270 on at
    RE: mandatory field in DirPartyQuickCreateForm

    i configured the field both  as mandatory and visible and still not showing up.

    I had to do besides this, to addthis fields to the table custtable --> field groups ---> quickcreatedetails.

    Thanks very much!

    Jorge

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: mandatory field in DirPartyQuickCreateForm

    Requested if you please explain your requirement in more clear way.

    may be by showing screen

  • Verified answer
    Rachit Profile Picture
    Rachit 4,011 User Group Leader on at
    RE: mandatory field in DirPartyQuickCreateForm

    Your custom field should be available in the list of fields inside the DirPartyEntity data source on DirPartyQuickCreateForm form. DirPartyEntity is actually referring to CustTable on this form.

    You can define field as Mandatory in the field properties on the form data source.  

    So if your field name is XYZ then you can go to \Forms\DirPartyQuickCreateForm\Data Sources\DirPartyEntity\Fields\AXYZ , right click -> Properties -> Make Mandatory as Yes.

    This will make your field mandatory on this form.

    Hope this helps.

    Thanks,

    Rachit Garg

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans