Skip to main content

Notifications

Dynamics 365 Community / Forums / Finance forum / How to make table fiel...
Finance forum
Answered

How to make table field mandatory without using personalization?

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
    AnithaEswaran 2,030 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
    Priyank Bhavsar 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
    Joris dG 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
    André Arnaud de Cal... 284,874 Super User 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
    nmaenpaa 101,146 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.

Helpful resources

Quick Links

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 284,874 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,425 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans