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
MohanaGopalMohanaGopal 

Flex Query

Hi..
      -- How can I passing values to Flex from salesforce for query retrival process..?
                 I have used one list button in my Custom object.. when I click list button it calls the flex application using S-controls.. In my flex I have to query based on parent record id or some fileds.. In salesforce we can used merge fields for identify the parent objects... How is it possible in Flex..               
      -- How can I use two query in Flex..?
                  I have to retrive data from two tables in different condition.. I have to display this result in two data grids..  How can I use this..
Any one have sample code..
Please Send me..
Ron HessRon Hess
to pass info to Flex, you can use the Flash vars which are passed into the Flex object from the browser. This is how the session id is passed in, see the flex toolkit for an example of passing a flash var.

look at this article:
http://wiki.apexdevnet.com/index.php/Flex_Hello_World

search for flashvar
MohanaGopalMohanaGopal

Thanks for ur reply..

         Its very helpful.. Now I able to pass arguments to Flex from Salesforce..

I have one more doubt..

        The following code work fine when my query return values.. If its null its shows

Error: #1009Cannot access a property or method of a null object reference.

 How to avoid it.... Is there any wrong in my code...

apex.query("select Name from Custom_Tasks__c where Project__c='"+Application.application.parameters.project_id+"'",

new AsyncResponder(

function (qr:QueryResult):void

{

var ar1:ArrayCollection=new ArrayCollection();

for(var j:int=0;j<qr.records.length;j++)

{

ar1.addItem({label:qr.records[j].Name});

}

combTask.dataProvider=ar1;

},

function (fault:Object):void{

Alert.show("Query Failed Task");

}

));