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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Javascript to set/ clear option set field on BPF

(0) ShareShare
ReportReport
Posted on by

Hi all,

I need to set/ clear option set field when the other two option set value is to Yes using Javascript on the Business process flow.I have this requirement on every stage gate.

for example is A(two option) set to "Yes" the Set the B(option set) to "Not available" and if A is set to "No" the B value is cleared i.e set to select(which is default).

Please help me with the JS code.

Thank you so much for any kind of pointers.

I have the same question (0)
  • Verified answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Have you tried using Business rule?

    If you want to access fields from BPF using Javascript, you will need to prefix field schema name with header_process_Field schema name

    neilparkhurst.com/.../

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Community Member Profile Picture
    on at

    Hi Bipin,

    Thank you so much for the quick reply.

    I can't achieve this using Business Rule because I am not able to clear the option set field using it.

    So, yes I have to go with JS.

    Can you please provide me with any detailed code if possible.

    My requirement is if I am on the particular stage gate and the option A is set to Yes the set option B else clear optionset.

    This above requirement I have on 3 stage gates to check

    anything will be helpful

  • Community Member Profile Picture
    on at

    Sorry for the late reply, thanks it worked

  • ALAN365 Profile Picture
    2 on at

    Hi Sravz,

    What's you final solutions, JS or Buz Rule?

  • Community Member Profile Picture
    on at

    Hi,

    I used JS  for this solution.

    BR doesn't work for this as I cannot clear the option set value.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 209 Super User 2026 Season 1

#2
CU11031447-0 Profile Picture

CU11031447-0 100

#3
NeerajPawar Profile Picture

NeerajPawar 71

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans