Multi select Pick list
-
27. august 2008 05:08
Hi all,
I need to create a multi select picklist on a Form , How do i achive this..
I saw ronald lehmann blog , which is for CRM v1.2
We ar using CRM 4.0
Please help me on this...
http://ronaldlemmen.blogspot.com/2005/07/multi-select-box-in-mscrm-v12.html
Alle besvarelser
-
28. august 2008 12:31
Hi Vishawz!
I have used the following Javascript function and it works for me(Using CRM 4.0). The basic approach is to store the selected picklist values on to ntext attribute. Copy this function on the Onchange Event of the picklist attribute. Pass the parameters required.
function MultiSelectPicklist_OnChange (picklistField, valuesField, separator)
{
var selectedValue = picklistField.SelectedText;
var values = valuesField.DataValue;
if (values == null) values = '';
// Skip if the selected value is the empty default
if (selectedValue.length > 0) {
// Unless the selected value already appears in the list...
if (values.indexOf(selectedValue) < 0) {
// Add it, including a separator if it's not the first value.
if (values.length > 0) values += separator;
values += selectedValue;
valuesField.DataValue = values;
valuesField.SetFocus();
}
}
}
Hope this helps!!
Thanks,
Shonai -
28. august 2008 14:37
This will probably let you to add picklist value to the ntext attribute but will not allow you to remove selected item.
I have a "messy" multi-picklist solution and also a multi-lookup solution (make all relationship to become multi-select). Let me know if you are interested or not.
-
29. august 2008 08:53Lee,
It would allow you to remove the selected item from the ntext attribute. If that is what you were refering to. Anyways, I am curious to know your solutions for Multi Select and Multi lookup custom solutions.
Thanks,
Shonai -
29. august 2008 09:28Thanks Shonai,
Ur code really helped me , It is working fine
Last wekk i had faced few problems on Multi Lookup
I would like know your solutions for Multi Select and Multi lookup custom solutions.
Once again Thanks a lot Shonai and Lee
-
29. august 2008 19:36
No problem. I will post it on my blog (which I am working on,
) and post it ASAP.
Jude
-
24. september 2008 11:00
hey thanx for the solution. But i want to know the parameters to be passed to the function.
u hav written the function as
MultiSelectPicklist_OnChange (picklistField, valuesField, separator)
{}
will the call be like this?
MultiSelectPicklist_OnChange (picklistField(name of the picklist) , valuesField(name of the text field here ntext) , separator (the seperator to be shown in text field) )
{
}
plz guide me as i am stuck over here from qrite some time.
Thanx and regards,
CoderAmul
-
26. september 2008 11:36
Amul,
The parameters to be passed are :
1. name of the picklist field
2. name of the ntext field
3. delimiter/separator (like : or ; etc)
Thanks,
Shonai