Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Answered

Javascript to set/ clear option set field on BPF

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,962 Moderator 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

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,564 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,651 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans