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 :
Microsoft Dynamics CRM (Archived)

How to change the subject based on selected value of an option set field?

(0) ShareShare
ReportReport
Posted on by 65

I have an option set field named "Fruits" and it has items "Apple", "Pears", and "Oranges". The subject field has content "I want to eat [SelectedValuefromFruitsField]". Is it possible to add a business rule so that the content of subject field will be updated whenever the selected value changed in the Fruits field? If yes, how? Thank you in advance!

*This post is locked for comments

I have the same question (0)
  • Sukh Gill Profile Picture
    967 on at

    Hi

    The easiest way to do this would be to use  workflow and then run the workflow on Create of the record and whenever the Fruit field is changed. 

    Sukh

  • CatEatDog Profile Picture
    65 on at

    Thank you very much for your response and recommendation, Sukh.

    This sounds more involved than I expected (I am new to MS CRM). I was hoping we could specify the subject field in the set field value textbox (i.e. "I want to eat %new_Fruits%."), but this seems not possible.

  • Verified answer
    Waqar Sohail Profile Picture
    on at

    You will need to add custom Javasript on the change of your option set or on Save of Form. Get the option set Text and append it with the Subject Field.

    var optionset = Xrm.Page.getAttribute("attributename")

    var optionText= optionset.getText();

    var  subjectText = Xrm.Page.getAttribute("subject").getValue();

    Xrm.Page.getAttribute("subject").setValue( subjectText +" "+ optionText);

    please also put the null values  checks .

  • Suggested answer
    CatEatDog Profile Picture
    65 on at

    Thank you very much, Waqar! It works!

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans