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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archive)
Answered

Mark field Not Required on BPF

(0) ShareShare
ReportReport
Posted on by 100

Hi,

How can we mark field not Required (optional) on BPF using JavaScript ?

I tried below, but it is not working for me.

 formContext.getAttribute("header_process_cri_productregistrationid").setRequiredLevel("none");
 
here, 
"header_process_cri_productregistrationid" is the schema name of the field.
Thanks in advance 
Categories:
  • Suggested answer
    Kenneth Ariel Chaves Herrera Profile Picture
    on at
    RE: Mark field Not Required on BPF

    Hi, here you can find the answer you are looking for:

    Set BPF Fields Required/Not Required using javascript - Microsoft Dynamics CRM Forum Community Forum

    If this was helpful, please check it as verified to help others finding useful information.

    Welcome to this amazing community.

  • Verified answer
    Pradeep Rai Profile Picture
    5,490 Moderator on at
    RE: Mark field Not Required on BPF

    Hi,

    Please try below steps:

    1. De-select the required checkbox from field of BPF as shown below:

    pastedimage1633632061566v1.png

    2. Now add logic in script make field required and not required using below syntax:

    formContext.getControl('header_process_<logical name of field>').getAttribute().setRequiredLevel('<none/recommended/required>');
    e.g.

     let formContext=executionContext.getFormContext();
    
    
        if(formContext != undefined)
        {
            let bpfControl=formContext.getControl('header_process_parentcontactid');
            if(bpfControl != undefined)
            {
                let attribute=bpfControl.getAttribute();
                if(attribute != undefined)
                {
                    attribute.setRequiredLevel("none");
                }
            }
        }

    We need to add both logic in script to handle required level of field. 

    Thanks,
    Pradeep.

    Please mark this as VERIFIED. If it helps

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 CRM (Archived)

Featured topics

Product updates

Dynamics 365 release plans