Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

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

*This post is locked for comments

  • 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,015 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

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans