I have added javascript for reverse the items in the picklist (rating) to the opportunity entity. It is done. but when I am filling the data and saving it, it is not saving the selected item from the rating picklist to the database. What do I have to do?
var oField = crmForm.all.opportunityratingcode;
var items = oField.options.length;
var arrTexts = new Array(items);
var arrValues = new Array(items);
for(i=0;i<items;i++)
{
arrTexts[i]=oField.Options[i].Text;
arrValues [i]=oField.Options[i].DataValue;
}
for(i=0;i<=items;i++)
{
oField.DeleteOption(i);
}
for(j=items;j>0;j--)
{
var oOption1 =oField.Options;
oOption1.Text=arrTexts[j-1];
oOption1.DataValue= arrValues [j-1];
oField.AddOption(oOption1.Text,oOption1.DataValue);
alert(oOption1.DataValue);
}