//actionscript
[Bindable] var comboList:Array = new Array();
var myPicklistValues:ArrayCollection = new ArrayCollection();
apex.describeSObjects(["Task"],
new AsyncResponder(function (result:Object):void
{
myPicklistValues = result[0].fields.Status.picklistValues;
for (var p:int=0;p<myPicklistValues.length;p++)
{
if (myPicklistValues[p].active)
{
var foo:PickListEntry = myPicklistValues[p].label;
comboList.push(foo);
}
}
}
}, genericFault));
//Flex code
<mx:ComboBox width="180" dataProvider="{comboList}" />
You may also like:
Joe,
Where are you getting the apex namespace from? I have force-flex.swc in my project but do not see that.
Thanks,
Phillip
Figured out that it’s part of SalesforceConnection.Connection.
It may be nice to state here that the code retrieves the “Type” picklist values from the “Task” object.
One note, be very careful when you C&P this code. The line numbers seem to throw off the formatting and placement.
The code works beautifully though!! Thanks a ton Joe.
Best,
Phillip
Glad to help, Phillip!