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 365 | Integration, Dataverse...
Suggested Answer

Saving lead entity without mandatory fields filled

(0) ShareShare
ReportReport
Posted on by

There are some mandatory fields on the lead form which are required for qualifying. But the user may not know the values when creating the lead and hence I want to allow saving without the mandatory fields filled. Any suggestions on how to do this?

I have the same question (0)
  • Suggested answer
    Torrado Profile Picture
    1,270 on at
    RE: Saving lead entity without mandatory fields filled

    Hello Sankalp,

    If the intention is to allow creating the Lead without populating some fields, you can set them as Optional.

    Then, you can create a simple Business Rule to set the fields as "Business Required", with redundant condition (e.g. "Created On contains data") to make it trigger only after the Lead record is created.

    Hope this helps you.

  • Sankalp Sreekar Profile Picture
    on at
    RE: Saving lead entity without mandatory fields filled

    The issue is that these fields need to be populated but only before qualifying the lead. Customers are clicking on the qualify button before filling in the mandatory fields.

    So the form should save without the mandatory values being populated but clicking qualify should trigger the message that the mandatory field was not filled

  • Suggested answer
    Torrado Profile Picture
    1,270 on at
    RE: Saving lead entity without mandatory fields filled

    Hello,

    If you want to have that validation only when pressing "Qualify" button, you can create a PreValidation Plug-in on Qualify message, that will fire only when clicking "Qualify" button.

    Inside the Plug-in logic you can check if the fields are populated and, if not, display a message to the user.

    Please mark the answer as verified if helpful.

  • Suggested answer
    David Yu Profile Picture
    on at
    RE: Saving lead entity without mandatory fields filled

    Hi Sankalp,

    You may set mark the field as optional from the entity and enable onload JS to change the field required level after the lead getting qualified.

    Here is the sample JS code for changing field required level. FYI

    setRequiredLevel (Client API reference) - Power Apps | Microsoft Docs

  • Sankalp Sreekar Profile Picture
    on at
    RE: Saving lead entity without mandatory fields filled

    Hi David,

    So there's a process which contains required fields at every stage. I've extracted the list of required fields and made them mandatory by using setRequiredField("required"), on loading the form. The problem is this prevents the lead from being saved without these fields filled during lead creation. The users wouldn't have this data beforehand and should be able to save the lead without the process provided required fields

  • Suggested answer
    David Yu Profile Picture
    on at
    RE: Saving lead entity without mandatory fields filled

    You may change it to not required at very beginning by formContext.getAttribute(arg).setRequiredLevel("none") and change it back once user qualifies the lead.

  • Sankalp Sreekar Profile Picture
    on at
    RE: Saving lead entity without mandatory fields filled

    But those fields are required for qualifying the lead. My requirement is that users should be able to save the lead without filling those fields but should fill them to qualify the lead

  • Suggested answer
    David Yu Profile Picture
    on at
    RE: Saving lead entity without mandatory fields filled

    You may leverage QualifyLead message in plugin to block the qualify action if some of the fields are blank.

    pastedimage1618886609058v1.png

    Please register the step as synchronized.

  • Suggested answer
    Torrado Profile Picture
    1,270 on at
    RE: Saving lead entity without mandatory fields filled

    Sankalp, as mentioned before, if you want to have that fields validation when pressing "Qualify" button, you need to create a synchronous PreValidation Plug-in on "QualifyLead" message, that will fire only when clicking "Qualify" button.

    Then, inside the Plug-in logic, you can check if the fields are populated and, if they are empty, block Lead qualification and display an error message to the user.

    Please mark the answer as verified if helpful.

  • Sankalp Sreekar Profile Picture
    on at
    RE: Saving lead entity without mandatory fields filled

    Hi,

    Is it possible to get the current BPF name and it's mandatory fields in the plugin? I am trying out this approach today and I'm stuck at getting the BPF mandatory fields

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
#ManoVerse Profile Picture

#ManoVerse 101

#2
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 66 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans