You need to sign in to do that
Don't have an account?
Steve Bair
Flex: Using apex.query in a component
I am trying to move the data reading portion of my actionscript to a class residing in a spearate .as file. I extracted the code that I needed from the main file and put it into the new file. Here is the structure...
package com.mydomain.components
{
import all the same stuff as the main file
public class Office
{
public class getData():ArrayCollection
{
apex.query(.......);
}
}
}
When the new file is saved, the error is 1120: Access of undefined property apex.
Does anyone know what I need to do so that flex can resolve the apex reference in the component?
Thanks.
now your class can access and use the apex as a variable shown in your code.
when you create the class office you pass in the apex connection created in you main file.
OK. I figured it out and took a slightly different approach.
I added a property to the class called "apx" declared as type Connection. From the caller, I just do obj.apx = apex;. This calls the set apx method in the class.
Bingo, there is apex -- all ready to use.