+ Start a Discussion

Flex toolkit R3.2: Sample app salesforce.mxml won't compile

The sample app salesforce.mxml compiled fine the last time I tried it (in Beta 2), but in R3.2 there is now functionality in it that won't compile for me:
     [java] C:\Java\Flex\SalesforceFlexToolkit_R3.2\salesforce.mxml(453):  Error
: Type was not found or was not a compile-time constant: LeadLookup.
     [java]             var ll:LeadLookup = PopUpManager.createPopUp(this, LeadLookup, true) as LeadLookup;
Ron HessRon Hess
thanks, for your report
I've found a missing file, i forgot to add the new file LeadLookup.mxml when i built the 3.2 version.

there is a new version which has this file, look for R3_4

let me know how this works.

Message Edited by Ron Hess on 06-03-2007 11:53 AM


No luck with R3.4:


     [echo] Compiling salesforce.mxml
     [java] Loading configuration file C:\Java\Flex\Flex_SDK\frameworks\flex-config.xml
     [java] C:\Java\Flex\SalesforceFlexToolkit_R3.4\LeadLookup.mxml(193): Warning: Data binding will not be able to detect assignments to "records".

     [java]     <mx:ComboBox id="leads" change="leadId = leads.selectedItem.Id;" dataProvider="{leadData.records}" labelField="labelField" ></mx:ComboBox>


I am getting these same errors with simpler objects in R3_4 like :

ArrayCollection, QueryResult, Connection...etc.

Please help...
Ron HessRon Hess
that's a warning, the app still compiles and runs, right?

I am getting similar errors and no, it does not compile and create an swf file.
C:\usr\flex_work>mxmlc -include-libraries=\usr\FlexSalesforce\bin\as3Salesforce.swc SfdcTest1.mxml
Loading configuration file C:\usr\Flex2\frameworks\flex-config.xml
C:\usr\flex_work\SfdcTest1.mxml(10):  Error: Call to a possibly undefined method LoginRequest.
    apex.login(  new LoginRequest({
C:\usr\flex_work\SfdcTest1.mxml(16):  Error: Call to a possibly undefined method AsyncResponder.
        callback : new AsyncResponder(render)
C:\usr\flex_work\SfdcTest1.mxml(23):  Error: Call to a possibly undefined method AsyncResponder.
        new AsyncResponder(
C:\usr\flex_work\SfdcTest1.mxml(24):  Error: Type was not found or was not a compile-time constant: QueryResult.
            function (qr:QueryResult):void {
C:\usr\flex_work\SfdcTest1.mxml(26):  Error: Type was not found or was not a compile-time constant: ArrayCollection.
                var ar:ArrayCollection = new ArrayCollection();
C:\usr\flex_work\SfdcTest1.mxml(26):  Error: Call to a possibly undefined method ArrayCollection.
                var ar:ArrayCollection = new ArrayCollection();
Here is the source for my code.
<—xml version="1.0" encoding="utf-8" –>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"


private function login():void {
    apex.login(  new LoginRequest({
        server_url : this.parameters.server_url,
        session_id : this.parameters.session_id,
        // put your own info here to test standalone
        username : 'clint_l_hegney@gelco.com',
        password : 'haj4mqmz',
        callback : new AsyncResponder(render)

private function render(result:Object):void {
    apex.query("Select Id, Name From Account limit 30",
        new AsyncResponder(
            function (qr:QueryResult):void {

                var ar:ArrayCollection = new ArrayCollection();
                for (var j:int=0;j<qr.records.length;j++  ) {
                    ar.addItem( {Id:qr.records[j].Id, Name:qr.records[j].Name});
                bg.columns = [new DataGridColumn('Id'), new DataGridColumn('Name')];
                bg.dataProvider = ar;
            function (fault:Object):void {}


<salesforce:Connection id="apex" />

    <mx:DataGrid id="bg" x="0" y="0" width="100%" height="100%">
            <mx:DataGridColumn headerText="Id" dataField="col1" />
            <mx:DataGridColumn headerText="Name" dataField="col2" />

Ron HessRon Hess
you will need to include the required import statements , these go inside the script CDATA block

import com.salesforce.results.*;
import com.salesforce.events.*; 
import com.salesforce.objects.*;
import com.salesforce.*;


there are more of these for Arrays, etc

     import mx.utils.ObjectProxy;
      import mx.collections.ArrayCollection;

basicaly one import for each object you want to use

Message Edited by Ron Hess on 06-19-2007 04:07 PM

Message Edited by Ron Hess on 06-19-2007 04:08 PM

Thank you Ron,

that did it...
I have been working with R4_1 and R4_0 and am seeing the same error:

"Type was not found or was not a compile-time constant: LeadLookup.   Should I go back to an eariler version of the lib?  I'm also running Flex Builder 3 via Eclipse 3.3 Plug-in

I'm so close!  Thanks for the help.
Ron HessRon Hess
yes, you should go back to a version that was working for you.

thanks for reporting this.
Hi Ron,

This is the 1st time I've experimented with your example, so I'm not sure which version would be best to revert to. I'm running the latest Adobe Flex on Eclipse 3.3. Can you point me to a compatible version of your lib?

Also, as a workaround, I just commented out those offending LeadLookup calls. The weird thing to is that I found the LeadLookup.mxml file, added it to my project, but still got the earlier reported compile error. Is there some special way to reference these supporting .mxml files from within an Eclipse project?

Lastly, with the workaround in place, I did get the app to run locally. It's so cool and extremely helpful! The next step was to try and load it up via an s-control (as outlined in this example:


The thing is, it won't render. I can see the Flash container, but no GUI. Looking at the Error console under Firefox shows a bunch of style sheet warnings, but no error. Any ideas??

THanks for the help and for the thoughtful example.
ALL IS WELL - It was a Firefox cache issue. I always assumed that a shift-reload combo on the browser would flush the cache. Alas, not always. Thanks again for all the help, Ron!