Flex and Coldfusion error handling

Hello! I was wondering if someone could point me in the right direction regarding error handling in a Flex app thats using an HTTPSERVICE RPC to a Coldfusion component.
If a user is entering form data in Flex and clicks submit... the data is sent via the HTTPSERVICE send method as XML to the CFC. But what if there is a Coldfusion SQL insert statement error? Say a user enters a character in a number field (now i know the best thing to do would be to have actionscript ensure that the values entered are numbers but lets keep that aside just for this example). How could I alert the user to let them know the CFC encountered a SQL error? Or better yet... alert them that everything went "A" ok and their data was successfully submitted.
I originally thought to put CFTRY and CFCATCH around the CFC code. I could do that fine, but had trouble passing back a message string so that FLEX could use it in an Alert.Show window.
Thanks!
-BosDog

Hey Mike,
Sorry after I posted I thought "this may be a question for CF guys as well".
I definitely use and love RemoteObjects. Its great for binding to datagrids and to run SQL to return data from the server back to Flex. I've struggled with successfully passing variables from Flex to CF using RemoteObject though. Say a dataform with 5 text fields & 2 combo box dropdowns.
I think you may have forgotten to post the link to the article for me to read... i didnt see it in your last post?
Thanks!

Similar Messages

  • How do I save a file to a server using flex and coldfusion?

    How do I save a file to a server using flex and coldfusion?
    On the CF side I might need to use this:
    <cffile action="UPLOAD" filefield="Filedata"
    destination="#expandpath('..\somepath)#"
    nameconflict="overwrite">
    And on the flex side I might need to use something like this:
    var sendVars:URLVariables = new URLVariables();
    sendVars.action = "upload";
    var request:URLRequest = new URLRequest();
    request.data = sendVars;
    request.url = _strUploadScript;
    request.method = URLRequestMethod.POST;
    _refUploadFile = new FileReference();
    _refUploadFile = _arrUploadFiles[_numCurrentUpload].data;
    _refUploadFile.addEventListener(ProgressEvent.PROGRESS,
    onUploadProgress);
    _refUploadFile.addEventListener(Event.COMPLETE,
    onUploadComplete);
    _refUploadFile.addEventListener(IOErrorEvent.IO_ERROR,
    onUploadIoError);
    _refUploadFile.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
    onUploadSecurityError);
    _refUploadFile.upload(request, "file", false);
    I just don't know how to put it all together in Coldfusion.

    try this...
    http://cf-creations.co.uk/blog/index.cfm/2008/9/20/Flex--File-Upload-Form--Part-One--Build ing-The-Initial-Form

  • Anyone know how to gernerate CRUD applications with flex and coldfusion?

    Anyone know how to gernerate CRUD applications with flex and
    coldfusion? I am working with a remote coldsfusion installation
    with MS SQL and I don't have RDS.

    You might investigate "squidhead". It is CF based. I'm not
    sure if it has any Flex related features.
    http://squidhead.riaforge.org/

  • SAP NetWeaver Gateway and JSON Error Handling

    Hello All,
    I am developing a small test application using Netweaver Gateway to understand the error handling.  I am using Postman to test the Gateway service.  I have developed small RFC FM to read return list of deliveries for a shipment.  The RFC reads in a shipment number and returns the list of deliveries.  The RFC also has Return parameter of type BAPIRET2 that stores the error message if shipment is not found.  We want to use only JSON format for the application.  So, I have set the 'Accept' parameter at request header to 'content/json'.  I am also aware of the exception /IWBEP/CX_MGW_BUSI_EXCEPTION that allows to throw an error message from backend suite.  I have that by having a Return parameter of type BAPIRET2, the generated method automatically handles the error message and sets the correct HTTP status.
    Now the Problem:
    As mentioned earlier, we want to use JSON format.  When I set the header parameter or specify $format=json in the URI the HTTP status code is always set to 500 when there is an error.  The error message about invalid shipment also is not returned.
    When I remove the JSON format parameters, the XML format is returned and HTTP status is set to 400 with appropriate error message.
    How can we get the Gateway to set the HTTP status code to 400 along with error message in the event of an error in RFC.  I have tried with the exception /IWBEP/CX_MGW_BUSI_EXCEPTION and BAPIRET2 return parameter but still does not work.  Is this a known issue in Gateway/JSON?
    Please see attached screenshots.
    Thanks,
    Rutul Thakkar

    Anyone have encountered this issue?  Any suggestions?
    Thanks,
    Rutul Thakkar

  • Dynamic value objects in flex and coldfusion 9

    I'm writing a program for a company that does registrations for conventions and trade-shows.  The problem I'm having is that each different client wants to store different data for each show.  Most of the data is the same (attendee's name, address, etc...), but each show has some customizations that it wants to have...  So each database for each show is going to be different...
    Right now, the only way I know how to transfer data from Flex to ColdFusion is via a Value Object.  (Well, the only good way to do it, that is.)  My problem comes when a client wants a particular database customized.  I have MANY questions about this...
    1) How do I tell my Value Object what fields we've added to or changed in the database without re-writing the entire VO (in both the .AS and .CFC files) and re-compiling my program?  In other words, I need a dynamic VO that changes automatcially with the database.
    2) If there is a way to dynamically create a VO in Flex (and from a few blog posts I've seen, it seems there is a way), how do I tell CF9 what the structure of that dynamically-created VO is?  Without re-writing a bunch of .CFC files every time I add or change a field in the database, that is...
    3) How do I reference the dynamically-created fields in my Flex program?  Right now, for example, I can define a variable called attendeeInfo as type attendeeInfoVO, and then reference things like attendeeInfo.first_name, attendeeInfo.last_name, etc...  How do I reference a field programmatcially when I don't know what it's going to be called beforehand?
    4) How do I make my program display/modify those dynamically-created fields?  Right now, using the attendeeInfo example above, I can create a TextInput with an id="firstNameInput" and just say firstNameInput.text = "{attendeeInfo.first_name}".  That won't work when I have no clue how many dynamically-created fields there are, or even what kind of data they're going to store...  How do I deal with this?
    5) Is there something other than VOs that would fit this situation better?  Am I limiting myself by using VOs in the first place?  Is it just plain impossible to do this with VOs?  And if so, what are my alternatives?  I need a structured object that can be passed around with a single reference -- I absolutely DO NOT want to pass a bunch of references to a bunch of different variables -- that's why I used VOs from the very beginning.
    6) Can I simply PAY someone at Adobe for one-on-one help here?  Do they have experts that you can "buy" for a few hours?  What's the charge for that, if such a thing is available?  Or, is this problem well-explained somewhere on the Web, and I just haven't found it yet?
    I'm very confused here, and it seems like I might have to re-write a ton of code, which I'm not looking forward to...  Ugh...  I appreciate any help you can give me...
    Thanks,
    Laurence MacNeill
    Mableton, Georgia, USA

    This blog post is pretty close to what I want:
    http://justinjmoses.wordpress.com/2008/10/10/flex-dynamic-bindable-value-objects/
    So there are the dynamic value objects I was looking for.  But the blog-poster is using LINQ and .Net 3.5.  I'm using ColdFusion9.
    So, how do I get ColdFusion9 to deal with that?  How do you get CF9 to recognize the fact that you've changed the VO, and deal with it appropriately?
    Thanks,
    L.

  • New SOD and enhanced error handling?

    Hi,
    I have been studying the new SOD. It looks very good. The only thing I am missing is enhanced error handling. Has this been dropped or is it under "Numerous functional and performance improvements"?
    Being able to catch exceptions from database triggers etc. is the only bigger flaw I see in this great tool ;-)
    Regards Pete

    Pete,
    Yes we are still intending to enhance our error handling capabilities.
    We have not finalized exactly what enhancements we are making with these yet.
    Regards,
    David
    Message was edited by:
    dpeake

  • Dreamweaver CS3 and Coldfusion Errors

    is anyone experiencing errors when using the coldfusion
    inbuilt tools within dreamweaver cs3? I am getting errors when
    using the insert record server beahaviour. Also i have noticed that
    some sql code is not genrated correctly within cs3. This was not as
    a problem in versions MX and 8.

    Have you posted this question in the Cold Fusion Forums?
    http://forums.adobe.com/community/coldfusion
    I don't use CF myself and the few CF coders I know have long since moved to Eclipse/ColdFusion Builder. 
    Nancy O.

  • Flex and ColdFusion and session facade?

    I want to deploy a flex application on an existing ColdFusion
    server. This server is already in production and uses a root
    Application.cfc to set session variables as well as authenticate
    the user to AD with getAuthUser. When I deploy my flex application,
    it fails because of the OnRequestStart cfcomponent within
    Application.cfc. I am wondering if this would be proper use of
    session facade? How do I best encapsulate session variables from
    the root Application.cfc within my new flex application? Basically
    I will need to follow the same authentication and cfset session
    guidelines that all of my other CF applications use, and my flex
    app needs to have theses session variables available to it, but I
    am not sure the best approach. Any insight is welcome.

    Did you enable session management in the Application.cfc or
    Application.cfm?

  • Flex and ColdFusion web services

    I have a simple CFC created that encompasses a function that
    has a query. I want to be able to use the web service in my Flex
    app, but I am having issues with getting the information from the
    CFC.
    My function is simple:
    <cffunction name="listBySubject" access="remote"
    returntype="query" output="false" hint="I grab the newest
    stories">
    <cfargument name="subject" type="string"
    required="yes">
    <cfquery name="list" datasource="#myDataSource#">
    SELECT linktext, story, photo
    FROM pressreleases
    WHERE rss_feed = <cfqueryparam
    value="#arguments.subject#" />
    OR rss_feed2 = <cfqueryparam value="#arguments.subject#"
    />
    ORDER BY releaseDate DESC
    </cfquery>
    <cfreturn list>
    </cffunction>
    How can I modify that to use in a Flex app's
    <mx:WebService>? Do I have to use cfsavecontent and return
    XML or can I keep it a query and use it with an ArrayCollection?
    Something like:
    <cffunction name="listBySubject" access="remote"
    returntype="xml" output="false" hint="I grab the newest
    stories">
    <cfargument name="subject" type="string"
    required="yes">
    <cfquery name="list" datasource="prmc-media">
    SELECT linktext, story, photo
    FROM pressreleases
    WHERE rss_feed = <cfqueryparam
    value="#arguments.subject#" />
    OR rss_feed2 = <cfqueryparam value="#arguments.subject#"
    />
    ORDER BY releaseDate DESC
    </cfquery>
    <cfsavecontent variable="storyList">
    <magStories>
    <cfoutput query="list">
    <magStory id="#ISBN#">
    <linkURL>#XMLFormat(linkURL)#</booktitle>
    <story>#XMLFormat(story)#</teaser>
    <photo>#XMLFormat(photo)#</price>
    </magStory>
    </cfoutput>
    </magStories>
    </cfsavecontent>
    <cfreturn storyList>
    </cffunction>
    Locally I can use RemoteObject all day with the way it is
    normally, but since UofMichigan has BlueDragon, I am forced to
    convert my apps to WebServices.

    Hi,
    Here is how to do the web services in coldfsuion.
    http://www.quackit.com/coldfusion/tutorial/coldfusion_web_services.cfm
    No in flex you call the webservices like:
    <mx:WebService id="webService"
    wsdl="
    http://www.flash-mx.com/ws/months.cfc?wsdl">
    <mx:operation name="getMonths"
    resultFormat="object"
    result="getMonths_result(event);"
    fault="getMonths_fault(event);" />
    </mx:WebService>
    http://blog.flexexamples.com/2008/04/14/calling-a-simple-web-service-from-flex-using-the-w ebservice-class/
    I hope this give you the idea.
    Rgds
    JFB

  • Flex and Coldfusion

    Hi everyone,
    Can someone tell me how I can enable and disable a button on
    my flex application based on access level using coldfusion mx 7.
    Please help me, thanks
    Cliffy

    just add a field in your db for the "access level" like
    1,2,3,etc then get that value from the select * from login where
    user=var and pass=var, that should give you back the level then you
    can use it however you want once you are returning it.

  • How do I change the location of the coldfusion-out.log and coldfusion-error.log files in CF10

    When I change the log location in ColdFusion Administrator it changes the location of most but not all the log files.  I have a requirement from my customer to place all log files on a separate partition on the server.  For ColdFusion 9 I was able to modify the registry settings to change StandardOut and StandardErr for the ColdFusion Jrun service.  This does not appear to the case for ColdFusion 10 which now uses Tomcat 7.
    I tried modifying log4j.properties file and was able to relocate the hibernatesql.log, axis2.log, and esapiconfig.log but not the coldfusion-out.log.
    I am running ColdFusion 10 Enterprise Edition on a 64-bit Windows 2008 Server.

    The location of the rest of the ColdFusion logs can be changed in the ColdFusion Administrator.  Go to the Debugging and Logging section, Logging Settings.  There is a form at the top of the page where you can change the log storage location.
    -Carl V.

  • Flex and coldfusion login

    Can someone tell me how I can create a popup login system
    using a coldfusion mx 7 backend. thank you.

    Check credentials then remove pop up? How can I remove the
    Popup login box after successful login? please help me...
    private function handleLoginSucess(eventObj:Event):void {
    //Get the member object from the LoginForm component
    PopUpManager.removePopUp(this)
    LoginForm.mxml
    public function
    resultGetMemberByUserNameAndPassword(event:ResultEvent):void {
    //used for debugging - shows details about result
    //returned by the CFC method
    //Alert.show( ObjectUtil.toString(event.result) );
    /*result returned is a Member object
    cast the result returned to a Member class
    and assign it to our Member object*/
    __member = event.result as Member ;
    //remove text in the login input fields
    username.text="";
    password.text="";
    // Define event object, initialize it, then dispatch it.
    dispatchEvent(new Event("loginSuccess"));
    PopUpManager.removePopUp(this)
    } //end function getMemberByUserNameAndPassword
    private function processLogin():void {
    //change state back to the default so the errorLogin state
    doesn't appear again
    currentState = '';
    //Alert.show("Processing Login...");
    MemberService.getMemberByUserNameAndPassword(username.text,
    password.text);
    }//end function processLogin
    }

  • How to uoload file with Flex and Coldfusion?

    Hi,
    I try some application but they can not work well.
    Please give me a hit for upload files.
    Thanks
    Mark

    See these FB help topics:
    Working with file upload and download
    Example: Uploading and downloading files
    Class FileReference

  • JPA and database error handling

    Can anyone point me towards any information or discussions on methods of handling database initiated exceptions with JPA? Specifically, I'm trying to handle common data exceptions, like primary/foreign key violations etc., so I don't have to duplicate that level of data integrity checking in my business logic.
    It seems I can only get hold of a RollbackException if something goes wrong. Ok, I can get into the underlying cause easily enough, but then I'm straight into implementation specific stuff (in my case, Hibernate exceptions). Are there any good techniques/patterns to reduce this dependency to an absolute minimum?

    In this situation I created @Id for one of the columns or created @IdClass from all view fields.

  • Cfc error when using Flex and RemoteObject (cross post)

    I have Flex 3.0.214193 and CF 8,0,0,176276 and Oracle
    10.2.0.3.
    I've been search for several days for an answer to this one.
    There is very little out there about this type of error, but then
    there is very little about any problems with Flex and ColdFusion.
    In Flex, I have two comment fields. the .cfc has two update
    functions that update the comments, because they are in two
    different tables. The first update works like a champ. The second
    one consistantly shows this error in the CF application log: The
    NEWENGREMARK parameter to the updateEng function is required but
    was not passed in. I've used the Alert.Show to verify that Flex
    does have a value in that variable when it calls the .cfc. I've
    even tried passing the first variable that worked in the first
    update, and even a litteral value. Everything yields the same
    cryptic error message. I must be looking at the wrong thing.
    The only things I've found on the web about this, say the
    variables should have a scope (is that a scope in Flex or in the
    .cfc) and the column names should be in upper case (because it's
    Oracle).
    Here's the .cfc code (is that where the error is, or is it in
    Flex?). The UpdateDescription function works, but the UpdateEng
    doesn't.
    Thanks for any help, or spelling errors you can point out.
    Scott

    Ian,
    I also heard about the case thing. So I tried everything in
    upper case and lower case - same thing. In my experimenting, I
    tried adding the newENGRemark parameter to the descriptionUpdate
    function call, I didn't do anything with it is the .cfc just
    declared it as required. In that case the parameter exists and
    everything is fine. But in the call to the UpdateEng, it doesn't
    exist.
    I changed the .cfc so that the newENGRemark was not required
    or had a default. In both cases the .cfc just skipped to the next
    parameter and said it didn't exist. But I was passing a litteral,
    it wasn't even a variable.
    I created a .cfm page that did a cfinvoke on the .cfc, and
    passed it two litterals. That worked fine. So that makes it look
    like some sort of syntax error in the Flex. So I deleted the call
    to the UpdateENG, copied the UpdateDescription call (because it
    works), changed just the minimum to make it work, but it didn't
    work.
    I think I am going to restructure the database so that I can
    do what I need to with just one update function, that seems to
    work.
    It still doesn't make any sense.
    Scott (Flex code is attached)

Maybe you are looking for

  • Error Message When Installing Quicktime

    I currently have Quicktime player version 7.1.3, and am trying to update the software to the latest version 7.6.4. When I try to run the installation, I get a error message that installation can not continue with the error given as "2756". This happe

  • Bridge CC opens older version of PS instead of PS CC

    Under Windows 7: Bridge CC "Open" and "Open with->Photoshop (default)" in the thumbnail context menu open PS5 which has been since uninstalled leaving PS6 and PS CC. "Open in camera raw" opens Camera Raw 8.1 associated with CC programs. "Place->In Ph

  • Operating System Size

    Hi, I have a 48 hour old Macbook with the 80gb hard drive. I have loaded nothing on it and it shows 57gb of available space. Can this be right? the OS and misceallaneous other programs take up 23 gb? I went as far as to try a new install from the dis

  • Migrating Japanese Characters from MS SQL Server 2000 to Oracle 9i usng Jsp

    Hi , I have a situation where the Japanese characters are to be migrated from MS SQL Server 2000 to Oracle 91 and then render the same using JSP. I followed the below approach, 1. Extract the Japanese data from MS SQL Server and generate an XML 2. Pa

  • Soap faultcode and faultstring getting lost

    Hi, I'm having a problem with Adobe Flex not returning the soap fault details that is being returned in the Soap Fault. I am using Flashplayer 9,0,16,0 , Adobe Flex Builder 2 Version 2.0.14359 and XFire 1.2 for Webservices. The Soap Request is : <SOA