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 :
Customer experience | Sales, Customer Insights,...
Answered

Mark field Not Required on BPF

(0) ShareShare
ReportReport
Posted on by 104

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 
I have the same question (0)
  • Verified answer
    Pradeep Rai Profile Picture
    5,489 Moderator on at

    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
  • Suggested answer
    Kenneth Ariel Chaves Herrera Profile Picture
    on at

    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.

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 74 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 31 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans