Announcements
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?
Hi,
you can try the below code in OnActivated/ initialised form method
datesource_ds.object(fieldNum(datesource, Fieldname)).mandatory(true);
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.
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?
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.
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.
André Arnaud de Cal...
294,217
Super User 2025 Season 1
Martin Dráb
232,978
Most Valuable Professional
nmaenpaa
101,158
Moderator