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

Community site session details

Session Id :
Microsoft Dynamics AX (Archive)
Suggested answer

Make a field mandatory. when any field is modified in form

(1) ShareShare
ReportReport
Posted on by 2
Hi,

I have a form that contains header and lines in toolbar and list pattern. In header I have a field /Reason for modification/. The requirement is to make this field mandatory when any modifications are made on header or line level.

can someone point me to right direction.
  • CU08070938-0 Profile Picture
    2 on at

    Microsoft Forms doesn’t natively support dynamic conditional logic to Ragdoll Hit make a field mandatory based on another field’s modification. However, you can use workarounds or integrate with Power Automate for advanced logic.


       
  • Martin Dráb Profile Picture
    225,155 Moderator on at
    Make a field mandatory. when any field is modified in form
    If your intention is that a reason must be provided when you change a line, your design is wrong. That a field in a header is made mandatory is irrelevant when you're saving a line (= a different table). You'll need to design it in a different way.
     
    If a line record can't be saved without the reason, you should show a dialog before saving the line, e.g. in validateWrite() of the line data source.
     
    Also, consider whether a mere field is sufficient, because it can hold only one reason, for the latest change. Reasons of the previous change would be overwritten every time.
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    6,407 on at
    Make a field mandatory. when any field is modified in form
    Hi,
     
    you must use this code based condition :
    if(...)
    {
       {{YourTable}}_ds.object(fieldNum({{YourTable}}, {{YourField}})).mandatory(true);
    }
    else
    {
       {{YourTable}}_ds.object(fieldNum({{YourTable}}, {{YourField}})).mandatory(false);
    }
    Best regards,
    Mohamed Amine MAHMOUDI

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 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 > 🔒Ι Microsoft Dynamics AX (Archived)

Featured topics

Product updates

Dynamics 365 release plans