Dynamick picklist in MS CRM 3.0
Let's start from the Error message:
'originalPicklistOptions' is null or not an object'
I am trying to create a classic Sector and Sub Sector dependancy.
Marius
*****
var oIndustry = crmForm.all.new_sector;
var iStartIndex = -1;
var iEndIndex = -1;
switch (oIndustry.SelectedText)
{
case "Agriculture":
iStartIndex = 1;
iEndIndex = 2;
break;
case "Automotive":
iStartIndex = 3;
iEndIndex = 5;
break;
case "Food Drink & Tabacco":
iStartIndex = 6;
iEndIndex = 9;
break;
}
var oSubIndustry = crmForm.all.new_subsector;
if (iStartIndex > -1 && iEndIndex > -1)
{
var oTempArray = new Array();
var iIndex = 0;
for (var i = iStartIndex; i <= iEndIndex; i++)
{
oTempArray[iIndex] = oSubIndustry.originalPicklistOptions
;
iIndex++;
}
oSubIndustry.Options = oTempArray;
oSubIndustry.Disabled = false;
}
else
{
oSubIndustry.DataValue = null;
oSubIndustry.Disabled = true;
}
*****

