1

I have a form in Microsoft CRM. there is a drop box with case type. I want to update the start time label based on case time. for an example, if someone select "Issue" as case time, I want the label to say "Issue start time". if the selection is "Request" I want it to say "Request Start Time".

Image 1

I have added a OnChange event to the case type field and I can get to print "Hello World" with the following java script.

Image 2

Can you please give me some direction on how to change the other label with this?

Many thanks.

Guido Preite
  • 14,905
  • 4
  • 36
  • 65
Achintha Gunasekara
  • 1,165
  • 1
  • 15
  • 29

1 Answers1

3

To fulfill your requirement you can check these pages:

http://crmbusiness.wordpress.com/2011/02/25/crm-2011-how-to-set-an-attribute-label-in-javascript/

how to get selected value from a option set crm 4 dynamics 2011 online

And you can use the following code as example (the function needs to be called inside the OnChange event)

function TestFunction()
{
      var dropdownvalue = Xrm.Page.getAttribute('casetypecode').getText();
      var affectedControl = Xrm.Page.ui.controls.get('prioritycode');
      affectedControl.setLabel(dropdownvalue + ' priority');
}
Community
  • 1
  • 1
Campey
  • 1,108
  • 9
  • 15
  • 1
    I edited your answer, if a user asks here (and in a good way as Archie) it's not necessary to remember that he will find the answer using google (where everybody can find answers for easy and hard questions). We are all here to learn and share, will be the community to decide (by upvoting, downvoting or closing) the quality of the question. I hope you understand my decision to edit your answer. – Guido Preite Aug 28 '13 at 06:38