- how to clear a PickList
- Posted by Eduardo on October 19th, 2007
hello,
It will maybe seem easy for you. But i've been trying to do a simple thing.
Delete the contents of a picklist.
I populate this picklist at runtime. On the onchange event of another field
I would like to clear the picklist.
I've tried to set the picklist.Options to null. but i get an error.
I also tried to assign the picklist an array but no results there.
Anyone has the correct usage of this .Options method? how should be the
array be configured, how many dimensions?
Please hellp me i'm using CRM 3.0
thanks
Eduardo
- Posted by Merijn on October 19th, 2007
Hi,
Please take a look at the Microsoft CRM 3.0 SDK. It has a section
specifically for the client customizations in JScript. Client Programming
Guide - Client Side Scripting - Form Object Model - Field Types, Properties,
Methods, - Field Type: Picklist. You should use AddOption and DeleteOption.
In the SDK are some examples which will get you up-and-running.
var oField = crmForm.all.SOME_PICKLIST_FIELD_ID;
// Determine how many items there are in the picklist.
alert(oField.Options.length);
// Set the value to 1.
oField.DataValue = 1;
// Show the the text for option #1.
alert(oField.SelectedText);
// Delete the first option by value.
oField.DeleteOption(0);
// Add an option to the picklist.
oField.AddOption("Test", 0);
Best regards,
Merijn
"Eduardo" wrote:
- Cheap wholesale clear shoes, clear AF1 low , clear Jordan, clearwomen's AF1, clear bape shoes at www.cheapforwholesale.com (Microprocessors) by globwholesale
- Picklist A to determine value of Picklist B (Windows CRM) by Dix
- Assign Picklist value to another Picklist (Windows CRM) by Daniel Rodriguez
- New Address type picklist value not appearing in picklist on forms (Windows CRM) by Mic Mayne
- possible picklist bug !!! (Windows CRM) by Rojer

