[quoted text, click to view] "developer2be" <webforumsuser@macromedia.com> wrote in message
news:c00pag$8f5$1@forums.macromedia.com...
> I have a CFC that returns a String Value back to Flash. I would like to
use a Message Box to display the returned valued from CFC.
>
> In other words, after inserting a record into DB, I would like to display
"Record Inserted Successfully!".
>
> How do I accomplish this in ActionScript?
>
> <!--- insert users informatin into database --->
> <cffunction access="remote" name="insertUser" returntype="string"
hint="Insert user profile/information into the database">
> <cfargument name="bemsid" required="true" type="numeric">
> <cfargument name="displayname" required="true" type="string">
> <cfargument name="lastname" required="true" type="string">
> <cfargument name="firstname" required="true" type="string">
> <cfargument name="email" required="true" type="string">
> <cfargument name="userRole" required="true" type="string">
> <cfargument name="userAccess" required="true" type="string">
> <cfargument name="disableAcct" required="true" type="string">
> <cfargument name="USPerson" required="true" type="string">
>
> <cfquery datasource="ttswt_users">
> INSERT INTO tblUsers (bemsid, displayName, lastname, firstname, email,
userRole, userAccess, disableAcct, userPerson)
> VALUES
(#bemsid#,'#displayName#','#lastname#','#firstname#','#email#','#userRole#',
'#userAccess#','#disableAcct#','#USPerson#')
[quoted text, click to view] > </cfquery>
>
> <cfreturn "New Profile Inserted Successfully!">
> </cffunction>
>
I usually wrap the <cfquery> tag inside <cftry> tags. If the database insert
occurs without an error, I return true. If an error occurs, I return false.
Then, in the onResult method in the ActionScript, I open a dialog box and
display the appropriate message to the user.
--
Paul
-------------------------
Team Macromedia Member for Central
http://www.macromedia.com/go/team/ Extending Knowledge, Daily
http://www.communitymx.com -------------------------