You need to sign in to do that
Don't have an account?

USING FLEX and ITS NOT WORKING AND I HAVE NO IDEA WHY!
Can someone please help me?? I'm trying to run the supposedly simple application in one of the flex tutorials only it DOES NOT WORK!!!!!! I TRIED EVERYTHING AND THE SALESFORCE DOCMENTATION IS 2247 PAGES LONG!!! HOW DO I GET STARTED WITH FLEX??? WHO DO I HAVE TO TALK TO???????? DOES ANYONE KNOW???
HERE IS THE CODE I'M TRYING TO RUN. I copied the toolkit SWC's into my lib folder in the project in FLEX and this is the exact code that is in the tutorial that is floating around YOUTUBE??? SO WHY IN THE HELL DOES IT NOT WORK WHAT AM I MISSING?????
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:salesforce="http://www.salesforce.com/"
applicationComplete="doLogin()">
<mx:Script>
<![CDATA[
import com.salesforce.results.LoginResult;
import com.salesforce.results.QueryResult;
import com.salesforce.AsyncResponder;
import com.salesforce.objects.LoginRequest;
private function doLogin():void
{
var lr:LoginRequest = new LoginRequest();
lr.username = "MY FREAKING USERNAME";
lr.password = "MY FREAKING PASSWORD";
lr.callback = new AsyncResponder(loginSuccess);
force.login(lr);
}
private function loginSuccess(result:LoginResult):void
{
force.query("SELECT Id, LastName FROM Contact", new AsyncResponder(querySuccess));
}
private function querySuccess(result:QueryResult):void
{
grid.dataProvider = result.records;
}
]]>
</mx:Script>
<salesforce:Connection id="force"/>
<mx:DataGrid id="grid" width="400" height="300"/>
</mx:Application>
First of all, lighten up on the CAPS LOCK KEY! Virtual yelling and flailing of arms and gnashing of teeth is not conducive to community participation.
Now, take a deep breath. There, that's better. Seems that you have been focusing on the toolkit and not the Flash platform. If you are trying to run your code from the local file system, you will need to modify the securty settings of your flash player. Flash has increased security controls over the last couple of years and one modification is to not implicitly allow flash movies served from local file system to execute the cross domain calls required for the toolkit to function properly.
Run your code again and when the blank screen appears, right-click the player and select "Settings". This will bring up a small dialog box with various setting choices. Click the big "Advanced" button to access the flash player settings web page.
Under the left hand navigation of that page, click "Global Security Settins Panel" to access the Global Security Settings Manager. You will see a widget like the one shown below. All you need to do is click "Edit Locations" and then "Add Location". Click the "Browse for folder..." button and find you way through the file system to your flex workspace folder. Once you have that path in the "Trust this location:" text box, click the "Confirm" button.
Go back to your project and re-launch your Flex app.
There are two very sophisticated platforms on either side of a Flex/Force.com implementation. Please familiarize yourself with both. Adobe has an excellent site for deveopers here Adob Flex Devnet.
You may now put your hair back in. :smileywink:
All Answers
usingSalesForce [Flex Application]
file:/C:/Users/MaceWindu/Documents/Flex%20Builder%203/usingSalesForce/bin-debug/usingSalesForce.html
Main Thread (Suspended)
usingSalesForce/doLogin
usingSalesForce/___usingSalesForce_Application1_applicationComplete
flash.events::EventDispatcher/dispatchEventFunction [no source]
flash.events::EventDispatcher/dispatchEvent [no source]
mx.core::UIComponent/dispatchEvent
mx.managers::SystemManager/preloader_preloaderDoneHandler
flash.events::EventDispatcher/dispatchEventFunction [no source]
flash.events::EventDispatcher/dispatchEvent [no source]
mx.preloaders::Preloader/displayClassCompleteHandler
flash.events::EventDispatcher/dispatchEventFunction [no source]
flash.events::EventDispatcher/dispatchEvent [no source]
mx.preloaders::DownloadProgressBar/timerHandler
mx.preloaders::DownloadProgressBar/initCompleteHandler
flash.events::EventDispatcher/dispatchEventFunction [no source]
flash.events::EventDispatcher/dispatchEvent [no source]
mx.preloaders::Preloader/dispatchAppEndEvent
mx.preloaders::Preloader/appCreationCompleteHandler
flash.events::EventDispatcher/dispatchEventFunction [no source]
flash.events::EventDispatcher/dispatchEvent [no source]
mx.core::UIComponent/dispatchEvent
mx.core::UIComponent/set initialized
mx.managers::LayoutManager/doPhasedInstantiation
Function/http://adobe.com/AS3/2006/builtin::apply [no source]
mx.core::UIComponent/callLaterDispatcher2
mx.core::UIComponent/callLaterDispatcher
file:/C:/Users/MaceWindu/Documents/Flex%20Builder%203/usingSalesForce/bin-debug/usingSalesForce.html
As far as cross posting I'm just trying get the answer to my question. For some reason its not connecting I think.
lr = (com.salesforce.objects.LoginRequest) com.salesforce.objects.LoginRequest (@5154b21)
force = (com.salesforce.Connection) com.salesforce.Connection (@4e81eb1)
applicationDomain = null
_applicationDomain = null
applicationServerName = null
_applicationServerName = null
applicationUrl = null
_applicationUrl = null
batchSize = <setter>
client = <setter>
_defaultServerUrl = "https://www.salesforce.com/services/Soap/u/15.0" : String
_internalServerUrl = null
IsLoggedIn = false : Boolean
isLoggedIn = false : Boolean
isLoggingIn = false : Boolean
_loginCallback = null
loginResult = null
_loginResult = null
organizationId = null
portalId = null
protocol = "https" : String
_protocol = "https" : String
serverUrl = null
sessionId = null
result = <errors during evaluation>
doLogin = <errors during evaluation>
lr.callback = (com.salesforce.AsyncResponder) com.salesforce.AsyncResponder (@501c589)
context = null
faultHandler = <getter>
resultHandler = <getter>
force.query = <errors during evaluation>
Its a login error I think. This is the error I get.Anyone got thi error and knows how to fix it
[FaultEvent fault=[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://www.salesforce.com/Soap/u/15.0?1000.1135473255999"]. URL: http://www.salesforce.com/Soap/u/15.0?1000.1135473255999"] messageId="2BDC7291-DEFF-39C9-4058-E1114C20C811" type="fault" bubbles=false cancelable=true eventPhase=2]
First of all, lighten up on the CAPS LOCK KEY! Virtual yelling and flailing of arms and gnashing of teeth is not conducive to community participation.
Now, take a deep breath. There, that's better. Seems that you have been focusing on the toolkit and not the Flash platform. If you are trying to run your code from the local file system, you will need to modify the securty settings of your flash player. Flash has increased security controls over the last couple of years and one modification is to not implicitly allow flash movies served from local file system to execute the cross domain calls required for the toolkit to function properly.
Run your code again and when the blank screen appears, right-click the player and select "Settings". This will bring up a small dialog box with various setting choices. Click the big "Advanced" button to access the flash player settings web page.
Under the left hand navigation of that page, click "Global Security Settins Panel" to access the Global Security Settings Manager. You will see a widget like the one shown below. All you need to do is click "Edit Locations" and then "Add Location". Click the "Browse for folder..." button and find you way through the file system to your flex workspace folder. Once you have that path in the "Trust this location:" text box, click the "Confirm" button.
Go back to your project and re-launch your Flex app.
There are two very sophisticated platforms on either side of a Flex/Force.com implementation. Please familiarize yourself with both. Adobe has an excellent site for deveopers here Adob Flex Devnet.
You may now put your hair back in. :smileywink:
I found that when on my home network, I can login and see the data in the grid.When on the office network, I could not even login. I suspect this is because our office network has a proxy. How can I change this?
Thanks.
Hi crm123,
Seems odd that it should not work with the proxy.
Here is a good article with a link to all the info you ever wanted about Flash security.
http://viconflex.blogspot.com/2008/08/why-no-sandbox-violation-running-from.html
Also, make sure you can login to your developer edition from the office network. Try opening a Force.com project against your developer edition using the Force.com IDE. If you can do that, then I would definitely look around google to find out what needs to be done to the Flex project to compensate.
Cheers,
Thank you for responding. I walked through the code and realized its not the proxy settings, but the fact that the sandbox instance I am working against is on a different set of servers.
var lr:LoginRequest = new LoginRequest(); sandbox.serverurl = "https://test.salesforce.com/services/Soap/u/16.0"; lr.username = "flextest@sandbox.com"; lr.password = "flextest123"; lr.callback = new AsyncResponder(loadGrid); sandbox.login(lr);
I can see my data now.