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

BPF field valdation with business rule

(0) ShareShare
ReportReport
Posted on by 100

Hi All ,

I am doing some customization on BPF present on case form . What I am trying to achieve is put two fields on BPF . One is option set with values YES and NO ,and one is text field. On Selecting YES from option set, I am making text field mandatory otherwise non-mandatory through business rule.

What I have understood that OOB behaviour of BPF is that , if any field is on BPF (not present on form) and it is required then Still we can make changes to the form and save , it will not validate the BPF required field. BPF required field gets validated only when we try move to next stage.

Now here is the issue which I am facing ,  whenever I am selecting yes on BPF and text fields becomes mandatory through business rule on BPF . Now when I am doing some changes to form and saving it , it is not getting saved asking me provide value of text field on BPF.

How can I make sure that this text field on BPF which I am making required trough business rule should get validated when we are moving to next stage , not on saving the form.

Thanks

1157.bpf.png

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: BPF field valdation with business rule

    Hi Vaibhab,

    Your understanding is correct  , as far as I know when you wans to make field mandatory in BPF you should add the field in the form as well to prevent the form save.

    Whenever any business rules fires it's basically apply on form fields and which apply then in the BPF field.

    I would suggest to add the fields in the forms and make it hide and then apply your business rules and set form notifications ,with focusing the BPF fields.

    You can also prevent using JS onsave method and validate the BPF field according to business requirements and  prevent saving the form.

    Hope this helps.

  • Suggested answer
    unizap Profile Picture
    on at
    RE: BPF field valdation with business rule

    Hi,

    You will have to implement branching in BPF to achieve this and this needs to be configured during BPF design only.

    In one branch where option set = Yes, set Name field as required. Keep Name field optional when it is NO.

    Refer this blog which explains this nicely:

    www.inogic.com/.../make-the-business-process-flow-fields-to-be-required-conditionally

  • Vaibhav Jaiswal Profile Picture
    100 on at
    RE: BPF field valdation with business rule

    Hi Goutam ,

    Thanks for your response !!

    What i want is to make fiels mandatory in BPF using business rule . I don't want to prevent form save.

    What i noticed is , when i make any steps (fields ) required in BPF from BPF design editor , it doesn't effect form saving , we can update the form without values in this BPF field . The BPF required field get validated only when we move to next stage. I think this is OOB behaviour

    Now when i   make any field required on BPF using business rule , it doesn't allow the updation of form until or unless we provide value in this BPF field.

    What i want to achieve is to make field required on BPF using busniess rule , and  the field should get validatied only when i  click on to next stage and not on save click. I want to update and save the form without providing the value in this BPF required field .

    Thanks

  • Vaibhav Jaiswal Profile Picture
    100 on at
    RE: BPF field valdation with business rule

    Hi Mayank

    Thanks for the response !

    In this case both the option set and name field is on same stage . I think branching will apply here only when we placed  the field on different stages.

    Thanks

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: BPF field valdation with business rule

    Hi Vaibhab,

    Your analysis is correct  - What i noticed is , when i make any steps (fields ) required in BPF from BPF design editor , it doesn't effect form saving , we can update the form without values in this BPF field . The BPF required field get validated only when we move to next stage. I think this is OOB behaviour

    Now when i   make any field required on BPF using business rule , it doesn't allow the updation of form until or unless we provide value in this BPF field.

    Unfortunately your requirement will not fulfill using business rules as business rules will work form level and entity level so making field business required using business rules will impact your form save.

    You can try to do this using JavaScript which will work only on BPF field like below if I am not wrong - 

     Xrm.Page.getControl("header_process_FieldName").setRequiredLevel("required");

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at
    RE: BPF field valdation with business rule

    BPF field works differently compared to form fields, so if you want to make your business process field required you need to access it using header_process like suggested above.

  • Vaibhav Jaiswal Profile Picture
    100 on at
    RE: BPF field valdation with business rule

    Hi Goutam ,

    Xrm.Page.getControl("header_process_FieldName").setRequiredLevel("required");

    This i have already tried setRequiredLevel is not work for BPF fields , it is also mentioned in this msdn article

    msdn.microsoft.com/.../gg334409.aspx

    Then i also use this

    Xrm.Page.getControl("header_process_description").getAttribute().setRequiredLevel("required");

    but it shows same behavior of using business rule it impacts form save.

    Any other ideas , will be happy to try !!

    Also is this the expected behavior i.e when we use business rule in BPF it impact form save . OR i am doing the wrong way.

    Thanks

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
UllrSki Profile Picture

UllrSki 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans