Skip to main content



No record found.

Dynamics 365 Community / Forums / Finance forum / Set field as mandatory...
Finance forum

Set field as mandatory in Vendors form

Posted on by 109
Hi All,
I need to mark custom field as mandatory based on vendor group, I have written code in onmodified event handler of Vendor group. It’s working as expected if workflow is disabled. when we change vendor group and submit to workflow, once workflow is approved custom field should mark as mandatory but its not working
please suggest
Thanks in advance!
  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 225,513 Super User on at
    Vendor Workflow D365 F&O
    If you put code to onModified, it'll execute only when you change the vendor group. If you close the form, open it again and look at your vendor, your code will have no effect because you didn't change the vendor group. You need to interpret the condition and set mandatory to true or false every time when you select a vendor, which means either extending active() method of the data source or using the corresponding event.

    Let me also change the title of this thread from Vendor Workflow D365 F&O to something more appropriate, because the question isn't really about a workflow and we don't need to repeat that it's about D365 F&O, because that's true for all threads in this forum.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,773 Super User

Martin Dráb Profile Picture

Martin Dráb 225,513 Super User

nmaenpaa Profile Picture

nmaenpaa 101,148


Featured topics

Product updates

Dynamics 365 release plans