Skip to main content

Notifications

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?

  • Verified answer
    AnithaEswaran Profile Picture
    2,032 on at
    RE: How to make table field mandatory without using personalization?

    Hi,

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

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

  • Priyank Bhavsar Profile Picture
    505 on at
    RE: How to make table field mandatory without using personalization?

    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.

  • Suggested answer
    Joris dG Profile Picture
    17,775 on at
    RE: How to make table field mandatory without using personalization?

    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?

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    294,217 Super User 2025 Season 1 on at
    RE: How to make table field mandatory without using personalization?

    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.

  • Verified answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: How to make table field mandatory without using personalization?

    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.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,217 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,978 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans