Asked by:
Add description for each pick list value

Question
-
Hi All,
The client I am working for wants to display a "description or explanation" for each pick list value on a form. The client is convinced that the end user would need this in order to make the proper selection. I am curious to see how some of you may have implemented this.
Thanks.
Friday, August 15, 2014 2:02 AM
All replies
-
You can create an HTML webresource to put beside your optionset field, when an option is selected, a text is displayed inside this webresource.
My blog: www.crmanswers.net - Rockstar 365 Profile
- Proposed as answer by Guido PreiteMVP Friday, August 15, 2014 3:21 AM
Friday, August 15, 2014 3:21 AM -
There are a few options you can choose from. This type of requirement usually incurs the following:
1 . Storage: Where to keep the description information
2. Retrieve: How to get the data to the form
3. Show: How to present the description on the form.
Regarding storage you can do the following:
-
Create another optionset on the same form.
-
Pros:
- i. Fast
- ii. Simple to retrieve
- iii. Supports translations
-
Cons:
- i. Requires a customizer to add, remove ,change descriptions
- ii. UI is not the most comfortable to work with.
-
Pros:
-
Create an entity to hold the description information.
-
Pros:
- i. Customer can add , delete , change values
- ii. UI is configurable and easy to use.
- iii. Support translations
-
Cons:
- i. less simple to retrieve info to the form
- ii. Slower solution.
-
Pros:
-
Put the description in your code
-
Pros:
- i. Fast
- ii. Simple to retrieve
-
Cons:
- i. Requires a programmer to make changes
- ii. Does not support translations
-
Pros:
-
Read the description from a configuration entity
-
Pros:
- i. Better configuration control
- ii. Power user can make changes
-
Cons:
- i. Does not support translations
- ii. Slower solution
-
Pros:
Regarding retrieval of data:
- If it’s a script or another optionset then it’s already a part of your form and it’s easier to code.
- If it’s stored elsewhere you need to use ajax or a webresource to load the data.
Regarding how to show the data:
-
Create a javascript tooltip
- Pros: The most divers solution
- Cons: Unsupported , Require good JS skills
-
Change the optionset title (alt) value
- Pros: Easy to implement
- Cons: Not supported, Not a pretty GUI.
-
Write it as a form notification
- Pros: Easy to implement, Supported
- Cons: The description appear on the top of the form and not near the optionset.
-
Write it on the field’s label
- Pros: Easy to implement, Supported
- Cons: Not a pretty GUI.
-
Write the value into another text field beside the optionset.
- Pros: Easy to implement, Supported
- Cons: Not a pretty GUI
-
If you chose to hold the data in another optionset you can display that disabled.
- Save as 4
-
Finally you can use a web resource as Guido suggested.
- I’ll let Guido elaborate on this if you’re interested in this type of solution.
I would personally go with:
Storage: 1
Retrieve: 1
Show: 3 (and clear the notification after several seconds using JS).
Cheers
Dev Blog: Dynamics CRM - Thinking outside the Box
Friday, August 15, 2014 3:20 PM -
Create another optionset on the same form.
-
Hi Mego,
I do not like the solution that I am proposing. But you can try some unsupported changes.
function onFocus() { Xrm.Page.getControl("rio_nameoninviteletter").setNotification("Name On Invite Format is Mrs. & Mr. Full Name!", "rio_nameoninviteletterCustom"); } function onBlur() { Xrm.Page.getControl("rio_nameoninviteletter").clearNotification("rio_nameoninviteletterCustom"); } // And inside Form_OnLoad var n = document.getElementById("rio_nameoninviteletter_i") if (n != null) { n.onfocus = onFocus; n.onblur = onBlur; }
Output is as shown below. you may have lot more work to do in your case.
I like Guido's solution best.
Regards,
Jithesh
Monday, August 18, 2014 4:46 AM