- Home
- Technical Library
- Boards
- Cookbook
- Code Share
- Blogs
- Partners
-
More
-
Services
- Training & Certification
- Support
-
Galleries
- Force.com Sites Gallery
- Chatter Challenge Entries
-
Other Web Sites
- Salesforce.com
- Database.com
- AppExchange
- CRM Community
-
Discussions
- Announcements
- General Development
- Schema Development
- New to Cloud Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules Discussion
- Security
- Mobile
- Force.com Sites
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby Development
- Adobe Flash Builder for Force.com
- Desktop Integration
- REST API Integration
- Streaming API
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- Excel Connector
- AJAX Toolkit & S-controls
- Force.com Builder & Native Apps
- AppExchange Directory & Packaging
- Force.com Labs Projects
- Open Source
- Siteforce
- Jobs Board - Administrators
- Jobs Board - Developers
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Visualforce Development
- :
- Re: as3Salesforce.swc - Flex Toolkit no longer wor...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
as3Salesfo rce.swc - Flex Toolkit no longer working?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-27-2009 08:19 AM
I'm befuddled and puzzled. I just got the Google Maps API for Flex to embed properly in SF and now I am trying to get a data grid to fill with SF data in the same SWF. I've gotten data out of Salesforce in the past using the as3salesforce.swc library but it doesn't seem to work anymore. I've been following threads about the appropriate server_url (which I've now replaced with v15 to no avail). Anybody else noticing problems with the toolkit?
<apex:page standardController="Location__c">
<apex:form >
<apex:pageBlock title="Flex implementation">
<apex:flash id="flexSOs" src="{!$Resource.SFFlex}" height="100%" width="100%"
flashvars="session_id={!$Api.Session_ID}&server_ur
</apex:pageBlock>
</apex:form>
</apex:page>
Here's the mxml code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:salesforce="http://www.salesforce.com/"
creationComplete="login(event)"
viewSourceURL="srcview/index.html">
<salesforce:Connection id="connection"/>
<mx:Script>
<![CDATA[
import com.salesforce.objects.SObject;
import com.salesforce.results.QueryResult;
import com.salesforce.AsyncResponder;
import com.salesforce.objects.LoginRequest;
import mx.core.IUIComponent;
import mx.managers.DragManager;
import mx.events.DragEvent;
import mx.collections.ArrayCollection;
import flash.external.ExternalInterface;
[Bindable]
public var selectedItem:Object;
[Bindable]
public var selectedSOs:ArrayCollection = new ArrayCollection();;
private function login(event:Event):void {
var lr:LoginRequest = new LoginRequest();
lr.server_url = parameters.server_url;
lr.session_id = parameters.session_id;
lr.callback = new AsyncResponder(getCandidateSOs);
connection.login(lr);
}
private function getCandidateSOs(o:Object=null):void{
connection.query("Select Id, A_Loc__c from Service_Order__c"
, new AsyncResponder(
function (qr:QueryResult):void {
candidateSOs.dataProvider = qr.records;
}));
}
]]>
</mx:Script>
<mx:Form id="frmPrintSO"
width="100%" height="75%"
borderStyle="solid" borderColor="#D4D4D4"
dropShadowEnabled="true" dropShadowColor="#B3B3B3"
shadowDirection="right" shadowDistance="10">
<mx:FormHeading label="Signature SOs" />
<mx:HBox>
<mx:VBox>
<mx:Label text="Candidate SOs"/>
<mx:DataGrid id="candidateSOs"
allowMultipleSelection="true"
dragEnabled="true"
dropEnabled="true"
dragMoveEnabled="true">
<mx:columns>
<mx:DataGridColumn dataField="Name"/>
<mx:DataGridColumn dataField="A_Loc__c"/>
</mx:columns>
</mx:DataGrid>
</mx:VBox>
</mx:HBox>
</mx:Form>
</mx:Application>
Solved! Go to Solution.
Re: as3Salesfo rce.swc - Flex Toolkit no longer working?
[ Edited ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-28-2009 01:35 AM - last edited on 04-28-2009 02:05 AM
If you get errors about invalid sessions, I noticed that the {!$Api.Session_ID} approach isn't always working. Why, I have no idea, but I got it working by using a Controllerextension which uses Apex to get the current session ID instead.
public class GetSessionControllerExtension {
public GetSessionControllerExtension(ApexPages.StandardController stdController) {
}
public String GetMySessionId() {
return UserInfo.getSessionId();
}
}
<apex:page standardController="Location__c" extensions="GetSessionControllerExtension">
<apex:form >
<apex:pageBlock title="Flex implementation">
<apex:flash id="flexSOs" src="{!$Resource.SFFlex}" height="100%" width="100%"
flashvars="session_id={!MySessionId}&server_url={!
</apex:pageBlock>
</apex:form>
</apex:page>
Re: as3Salesfo rce.swc - Flex Toolkit no longer working?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-28-2009 03:05 PM
Re: as3Salesfo rce.swc - Flex Toolkit no longer working?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-28-2009 04:15 PM
That is very strange, i'm glad you got it working.
Those session ID's should be the same, unless i'm missunderstanding something.
Salesforce Developer Evangelist
Check out the developer documentation | Got an idea? | Vote for this Idea!
Re: as3Salesfo rce.swc - Flex Toolkit no longer working?
[ Edited ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-29-2009 01:00 AM - last edited on 04-29-2009 01:44 AM
Yes, that was my understanding also. And interestingly enough, sometimes it works. Sometimes it doesn't. I tried it with several different Orgs, Enterprise and Developer, with namespaces and without and couldn't find a pattern to track it down reliably.
It might depend on the cluster the org is residing on, but that's just a guess.
Maybe someone from the SFDC Dev team can look into it?
Re: as3Salesfo rce.swc - Flex Toolkit no longer working?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-28-2009 12:47 PM
Re: as3Salesfo rce.swc - Flex Toolkit no longer working?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-24-2009 10:41 AM

