Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Answered

Javascript to set/ clear option set field on BPF

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Javascript to set/ clear option set field on BPF

    Hi,

    I used JS  for this solution.

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

  • ALAN365 Profile Picture
    ALAN365 on at
    RE: Javascript to set/ clear option set field on BPF

    Hi Sravz,

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Javascript to set/ clear option set field on BPF

    Sorry for the late reply, thanks it worked

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Javascript to set/ clear option set field on BPF

    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

  • Verified answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Javascript to set/ clear option set field on BPF

    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/

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans