function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ekmekm 

PickListEntry and Flex - issue with retrieving data from multiple picklists

Hello,

I'm attempting to retrieve data from 2 picklists (Account table, Industry field; and Event table, ShowAs table) from the salesforce data and display in a flex application.
I'm able to retrieve data from one picklist and display in a combo box without any problem. The problem I'm having occurs when I attempt to retrieve data from another picklist and display in a 2nd combo box.

I'd really appreciate it if someone were to let me know if I'm approaching this the wrong way, and/or I'm missing something.

Thanks in advance for any help you have to offer.

Regards,

Errol

    [Bindable]
    public var picklistValues:Array = new Array();
   
    [Bindable]
    public var picklistValues2:Array = new Array();
       
    [Bindable]
     public var pickListEventType:PickListEntry;
     
    [Bindable]
     public var pickListEventType2:PickListEntry;
     
//functions calling picklist data  
 
    public function describeEventTypeSObjects():void {
 
     var myPicklistValues:ArrayCollection = new ArrayCollection(); 
     apex.describeSObjects(["Account"], 
        new AsyncResponder(function (result:Object):void 
     { 
         myPicklistValues = result[0].fields.Industry.picklistValues; 
         for (var p:int=0;p<myPicklistValues.length;p++) 
         { 
             if (myPicklistValues[p].active) 
             { 
                 var pickListEventType:PickListEntry = myPicklistValues[p].label;
                 picklistValues.push(pickListEventType);
             } 
     }  
  
     }, genericFault));

    }
   
    public function describeEventTypeSObjects2():void {
     
     var myPicklistValues2:ArrayCollection = new ArrayCollection(); 
     apex.describeSObjects(["Event"], 
        new AsyncResponder(function (result:Object):void 
     { 
         myPicklistValues2 = result[0].fields.ShowAs.picklistValues2; 
         for (var p:int=0;p<myPicklistValues2.length;p++) 
         { 
             if (myPicklistValues2[p].active) 
             { 
                 var pickListEventType2:PickListEntry = myPicklistValues2[p].label;
                 picklistValues2.push(pickListEventType2);
             } 
     }  
  
     }, genericFault));

    }

//combo boxes where I'm wanting to display the data

<mx:ComboBox id="cmbType1" dataProvider="{picklistValues}"
        ></mx:ComboBox>
<mx:ComboBox id="cmbType2" dataProvider="{picklistValues2}"
        ></mx:ComboBox>