What happens when you force fields on BPF to be required programatically or using Business Rule

I had a requirement where I needed to make certain fields on BPF as required.

So, I tried accessing the control using Xrm.Page.getControl(“header_process_description”) and then getAttribute().setRequiredLevel(“required”) on it would serve my purpose. But actually, not!

To set perspective, the code runs and make the field required too. But there’s a catch!

Required fields on the BPF are supposed to throw an error when you are trying to move to the next stage without filling in the required fields.

But, using the code I’m talking about above (sample shown below), will force you to save the form entirely. Let alone moving the stages further.

jsCode

That when ‘How Did You Hear About Us?’ field has Employee Referral as value, make Purchase Process field required.

empoyeeReferalSet

Field is on the BPF

fieldOnBPF

But prompts me to save the form
promptToSave

 

Workaround

The easiest workaround to this is using the conditional branching of your business process flow –

You can use conditional branching of the BPF itself – You can replicate the same stage twice, one having your required field and other having that same field as optional.

bpfBranching

However, limitations I found with this approach is –

  1. I couldn’t use the same for the first stage of the BPF –
    limitation1
  2. The condition had to be from the previous stage itself
    limitation2

P.S. Business Rules isn’t a solution as well. Also, I tried to inverse the logic by first making the field required in the BPF itself and then trying to make it not required using code. That doesn’t work either.

Hope this gives an idea. Let me know if you have other suggestions! 😊

 

Advertisement

Get GA version of Dynamics 365 PSA v3 from Insider program

Hi! Dynamics 365 PSA v3 just hit v3 lately and here’s how you can get it.

  1. You’ll need to be an Insider program member to be able to subscribe to the GA program.
    Dynamics Insider Program
    insider Home Scree
  2. Look for the D365 For PSA Unified Interface Program
    psaUnified
  3. Signup Link on the details section
    signUpLink
  4. Fill out the form which asks your info about the tenant details and you can get your D365 PSA v3 GA on your tenant in a day or two.
    installV3

Hope this quick one helps you. 🙂

Clean your Schedule Board: Hide Cancelled Bookings

Most times in D365 PSA or Field Service, you schedule something and then cancel due to uncertain work patterns and frequent rescheduling or cancellations.

This leaves your Schedule Board cluttered and often look messy! Something like this –

clutteredScheduleBoard

You have on 2 Projects that you actually have to work with but see a few other cancelled bookings which is just taking space and that info is something you don’t need.

Hide away the Cancelled Bookings

Most often, you don’t really need to know what Bookings you cancelled, so you can just hide those away and make the Schedule Board look cleaner!

  1. Navigate to Scheduler Settings represented by the gear icon.
    schedulerSettingsIcon
  2. Look for Hide Canceled under View Settings area and check mark it.
    hideCancelledOption
  3. Once you mark it, the Cancelled Bookings will be hidden giving you a cleaner Schedule Board.
    cancelledHidden
  4. And now, your Schedule Books like pretty much sorted.
    cleanScheduleBoard

Hope this quick tip helps!