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

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
    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

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 185 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 110

#3
Gerardo Rentería García Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans