web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to make table field mandatory without using personalization?

(0) ShareShare
ReportReport
Posted on by 505

Hello Experts,

I need to make SalesPoolId field of a SalesTable mandatory.

I created a table extension and tried to overwrite ValidateWrite method of the table but I cannot save SalesTable.xpp file.

How can I accomplish this?

I have the same question (0)
  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Hi,

    in D365 you can't overwrite methods. You can write event handlers or use Chain of Command to hook your extension code to standard methods. If you type those things to web search you should find documentation, examples, blogs and discussions.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at

    Hi Priyank,

    In addition to the reply from Nikolaos:

    Is the requirement to have the sales pool always mandatory (for all legal entities)? In that case, you can create a table extension and change the Mandatory property instead of using x++ coding.

  • Suggested answer
    Joris dG Profile Picture
    17,775 on at

    You should consider making the field mandatory through a table extension if that is all you are after. It's a property on the field.

    Make a table extension, find the salespoolid field and mark as mandatory.

    Just make sure this is what you want - as any logic using the table make require this now.

    Optionally, although technically not considered good practice, you can make the field mandatory just on the sales details FORM. You can do a form extension to accomplish that. That would be similar to a personalization, but then for all users. Which sounds more like what you are after?

  • Priyank Bhavsar Profile Picture
    505 on at

    Hi Andre and Joris,

    As per your suggestion I tried to make it mandatory using table extension but mandatory property is disabled so I can't change it.

    I may need to do it on the form.

  • Verified answer
    AnithaEswaran Profile Picture
    2,032 on at

    Hi,

    you can try the below code in OnActivated/ initialised form method

    datesource_ds.object(fieldNum(datesource, Fieldname)).mandatory(true);

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans