CFAJAXPROXY / JavaScript: get @@IDENTITY ?

Hello, everyone.
(This is back on, now.)
Been giving this one a lot of thought, and just don't know enough about using CFAJAXPROXY to figure it out.
Another  developer has created a CFC that has many, many functions in it.  I'm  using CFAJAXPROXY and JavaScript to access one or two of the functions.
One  of the functions will add a row of data to a table with just a few of  the columns populated with data (the rest are 'allow null').
What  I'm trying to do is get the page to refresh with that new record  populating some of the form fields.  The data that populates is chosen  by a CFSELECT tag with an onChange event.
Can anyone think of a  way, via JavaScript, to get the @@IDENTITY of the data that was just  entered into the table?  If it were pure CF, I'd just put another query  immediately after the insert query, and surround both of them with a  CFTRANSACTION tag.  But I don't think JavaScript has an equivalent.
Thanks,
^_^

cfsilence wrote:
cfajaxproxy is just a - proxy - that calls the server side component via Ajax so if you need to return the ID of the newly created record you can just return it from the component and the ajaxproxy should get the value.  You might also want to look at getting the generated key/id via cfquery's result attribute instead of using @@Identity.
Unfortunately, I don't think modifying the method is an option; it's currently returning a string that is the query generated to insert the data into the table.
Is there a way to access the generated key/id from the query that is being run by the method?
Thanks,
^_^

Similar Messages

  • CFAJAXPROXY / JavaScript: get @@IDENTITY of data just entered

    Hello, everyone.
    Been giving this one a lot of thought, and just don't know enough about using CFAJAXPROXY to figure it out.
    Another developer has created a CFC that has many, many functions in it.  I'm using CFAJAXPROXY and JavaScript to access one or two of the functions.
    One of the functions will add a row of data to a table with just a few of the columns populated with data (the rest are 'allow null').
    What I'm trying to do is get the page to refresh with that new record populating some of the form fields.  The data that populates is chosen by a CFSELECT tag with an onChange event.
    Can anyone think of a way, via JavaScript, to get the @@IDENTITY of the data that was just entered into the table?  If it were pure CF, I'd just put another query immediately after the insert query, and surround both of them with a CFTRANSACTION tag.  But I don't think JavaScript has an equivalent.
    Thanks,
    ^_^

    Nevermind.  I was just informed that I'm adding data to the database when I'm supposed to wait and add it, later.  Sorry.
    ^_^

  • Get ident to work on Mac Snak IRC software in OS 10.6

    I am trying to get ident to work on Mac Snak IRC software on Mac OS 10.6. I installed their optional ident software. But, the IRC server always reports no ident response. I tried enabling port 113 on the router, even tried turning the firewall off, but it still doesn't work. Anyone have a solution to this?
    thanks, Kevin

    E-mail: support AT snak.com and replace the AT with an @

  • How does javascript get string from applet?

    hi, sir/madam:
    I use an applet to deal with simulation, make the results to be a string and want to save it in a text file. Certainly, using applet to write local file is not good method (though I have some idea about it). I want that javaScript write something in browser and I save it with my mouse (manual) as a text file.
    thank for your help.
    xn
    could javaScript write/read local file?

    There is a nice JavaScript forum that you can visit if you have tough JavaScript questions:
    http://forums.webdeveloper.com/forumdisplay.php?s=a23bf83c088c66ac3adde0c3c5616bae&forumid=3
    I'm not implying that ppl here don't know JavaScript or anything like that.....
    In answering your questions, a Java applet can read from and write to local disk if proper permissions are granted either via a signed applet or setting the Java access right. Signing an applet can be a royal pain in the butt because you have to sign it one way for IE, another way for NN4, and yet another way if you use a plugin, etc....but here is a link in case you're interested:
    http://developer.java.sun.com/developer/qow/archive/167/index.jsp
    A JavaScript definitely cannot read from or write to a local disk unless you get help from something like MS ASP or VB scripts. The only reason you were able to read thru the appletviewer is because it's not a true browser and it's written by Sun to work with their own product.
    As far as using javascript to get information from an applet, you can try to make your applet scriptable via Netscape JSObject. I know for sure it works with IE and NN4+ but last time I tried, Sun and Netscape were still having trouble getting LiveConnect to work properly with NN6+.
    And there you have it.
    ;o)
    V.V.

  • How to get Identity status value in EventHandler

    Hi,
    Could you please let me know how to get the "Identity Status" attribute value in EventHandler.
    I want to perform some operations based on the value do "Identity Status" but when I am running Trusted Recon I am not getting the value of this attribute.
    Could you please let me know how to get the value for the same.
    Thanks

    hope you are talking about postprocess handler.
    have you checked the target entities of orchestration .
    Even you can check the UserMnager API
    code ex:
    public BulkEventResult execute(long l, long l2, BulkOrchestration bulkOrchestration) {
    try{
    String operation=bulkOrchestration.getOperation().trim().toString();
    HashMap<String, Serializable>[] parameters = bulkOrchestration.getBulkParameters();
    String[] entityIds = bulkOrchestration.getTarget().getAllEntityId();
    debug("<---------- Calling " + getClass().getName() + ": Operation[" + operation + "] Parameters Size[" + parameters.length + "] BulkEventResult ---------->");
    HashMap eventDataHashMap = bulkOrchestration.getInterEventData();
    Identity[] currentUserStates = (Identity[]) eventDataHashMap.get("CURRENT_USER");

  • Javascript gets invisible

    Hi Experts,
    I'm trying to get some javascript code into a xsl file which is responsible for the rendering of a xml file created with the wep page composer. I tried the following:
            <xsl:text disable-output-escaping="yes">
                </script>
                     document.write("Hallo");
                </script>
            </xsl:text>
    When I'm looking into the source code of the rendered document, I can't find these lines. When I'm trying something like this:
            <xsl:text disable-output-escaping="yes">
                 "Hallo"
            </xsl:text>
    it is displayed in the page. I also had this problem (javascript is removed automatically) when I want to add some js into a jsp page. What do I have to regard when implementing javascript? Thank you!
    Edit: The / char in the first script tag is required for displaying the code in this threa, otherwise it doesn't show the code.

    Hi,
    the javascript is suppressed because of the xsl tags around it. When I use
    </script>
    alert
    </script>
    it works. But I can't put any " chars in the code because they get replaced. Is there any possibility to avoid this? I tried <xsl:script language="JavaScript">....</xsl:script> but that does not work. Maybe any other xsl tags where I can set the property html

  • Javascript get item label

    Hi there,
    I am using some client side javascript, does anybody know what function I can use to get a label for an item, can I use the $x function? thanks, Anil

    Hi,
    You can query APEX_APPLICATION_PAGE_ITEMS view
    Regards,
    Jari

  • Javascript get session value

    I would like to display a "Confirm message box " with javascript , eg Confirm ("Sure to Delete (Y/N") , the confirm message should depend on some condition from session bean . For example , if the user select the current lanuage on Login , session bean should keep a value to store the current language , afterward if the user delete a record , the content of the confirm message will depend on the lanugage which the user selected .
    Do anyone can help me how to get a value from session in javascript .
    Thanks

    Hi,
    You can create invisible static field (or other component) bound to session bean property you need. In JavaScript, you can get value of this static field.
    Thanks, Misha
    (Creator team)

  • Cant get @@IDENTITY

    I have a table TESTTABLE which has an identity column as its primary key. Now i have an INSERT statement which I want to execute and then get the key generated for the new row. So what I did is :
    String sqlStatement = "INSERT INTO TIMECARDBATCH ( name, desc ) VALUES ( 'TOR', 'Toronto' )";
    slqStatement += " SELECT @@IDENTITY";
    Connection cx = null;
    Statement stmt = null;
    ResultSet rs = null;
    int intReturnValue = -1;
    try {
    cx.prepareCall( sqlStatement );
    stmt.execute();
    rs = stmt.getResultSet();
    if (rs != null) {
    rs.next();
    intReturnValue = rs.getInt(1);
    Whats happening is that I am getting rs as null. As a result I cant get the identity generated. Any reason why this is happening?
    Application Server: JBoss 3.2.3
    Database: MS SQL Server 2000
    JDBC Driver: MS SQL Server JDBC Driver
    Thanks

    Actually, if I read that right, I'd be surprised if it even works. Are you smothering exceptions?
    You're trying to execute this: INSERT INTO TIMECARDBATCH ( name, desc ) VALUES ( 'TOR', 'Toronto' ) SELECT @@IDENTITY"I doubt that's legal SQL.
    You can either execute two separate statements, or maybe make them part of a batch.
    Also, I'm not sure why you're even using CallableStatement. It looks like you should just be using a PreparedStatement. And inside the "VALUES" part you should just have (?, ?) and then use PrepearedStatement's setString() to set those values. That keeps you out of trouble having to deal with escaping special characters.

  • Cannot get identity server console Webserver

    Identity Server was installed under Webserver.
    But each time when trying to get amconsole,
    it complains about "Server Error. This server has encountered an internal error which prevents it from fulfilling your requests."
    When I checked the webserver logs, it shows " The web application [amserver] is unavailable because of errors during startup. Please check the logs for errors"
    Thanks for advice!

    Thanks for reply!
    In the error logs, it only shows that "Adding web module: context=/amserver, location = /opt/SUNWwbsvr/https-server1/is-web-apps/services
    not sure if there are problems there.
    Thanks for advice!

  • Javascript get.clear('RP');

    I am using this function to reset the pagination for a report. However, I couldn't find any
    documentation on this function. Can it be used to reset the pagination of any page or it is
    just for the current one?
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

    Hi Denes, Carl,
    I need to incorporate a repaginate call in one of my javascript functions, so as to conditionally reset pagination before refreshing a report with html_PPR_Report_Page(...).
    I can't find anything on get.clear('RP').
    I have:
    //clear chatmsglist pagination
    get.clear('RP');
    //which doesn't work. Investigate.
    //refresh the report
    html_PPR_Report_Page (null,'R33122...
    //which is fine
    Could either of you - or anyone else - spell out how this might be done?
    Thanks
    jd

  • Acrobat Javascript get Windows PDF creation time

    Is there a way to get the Windows creation time of a PDF in Acrobat Javascript? When you copy a PDF the Windows creation time changes but the PDF creation time does not. I'm looking for a way to detect if someone copied the PDF.

    I know you can get the PDF creation time through the info object but that isn't what I want. When you copy-paste a PDF in Windows the creation time of the info object doesn't change. It always stays the same so I can't detect a copy that way. I want the creation time that Windows provides. Is that possible?

  • Javascript - getting part of a string

    I guess this is not a dreamweaver question per se, more
    strictly javascript
    but I know a lot of people here are pretty well versed so I
    hope it is ok
    if I ask here.
    I have the strings
    Method1 ($5.49)
    Method2 ($9.99)
    I wish to retrieve just the numerical values and assign them
    to variables.
    So I guess in pseudocode what I want is to get whatever lies
    between the
    character strings '$' and ')' leaving me with 5.49 and 9.99
    respectively.
    I've been fiddling with str.match and other regular
    expression things which
    I do not fully understand and so far no luck.
    Any help is much appreciated.

    I know about regexp but don't know how to do what I need.
    Anywhere in
    particular you know of that can explain it? I've been stuck
    trying to
    figure it out for quite a while now.
    "Franz Marksteiner" <[email protected]> wrote
    in
    news:f4diu5$7of$[email protected]:
    > "E Eds" <[email protected]> schrieb im Newsbeitrag
    > news:[email protected]..
    >>I guess this is not a dreamweaver question per se,
    more strictly
    >>javascript
    >> but I know a lot of people here are pretty well
    versed so I hope it
    >> is ok if I ask here.
    >>
    >> I have the strings
    >>
    >> Method1 ($5.49)
    >> Method2 ($9.99)
    >>
    >> I wish to retrieve just the numerical values and
    assign them to
    >> variables.
    >>
    >> So I guess in pseudocode what I want is to get
    whatever lies between
    >> the character strings '$' and ')' leaving me with
    5.49 and 9.99
    >> respectively.
    >>
    >> I've been fiddling with str.match and other regular
    expression things
    >> which
    >> I do not fully understand and so far no luck.
    >>
    >> Any help is much appreciated.
    >
    > Try to read into "RegExp" (Regular Expressions).
    > RegExp will allow you to specify some pattern, and
    extract parts (in
    > your case the numerical ones) of it.
    >
    >

  • Part of javascript gets displayed on website

    Hi for my webform I have a javascript validation function to
    help make sure user's don't accidently leave some parts blank. Well
    the validation part works great. However, when I load up the
    webpage it displays part of the javascript at the top.
    Here is a link so you can see for yourself:
    http://www.drmarcverner.com/eforms/patient_registration_text_leftalign.htm
    I hope somebody knows how to fix this.
    Thanks

    nevermind. I just realized that i'm an idiot and accidently
    had stuff outside of the <script></script> tags.
    Sorry to waste your time.

  • Air Javascript - Get path from user selected directory

    Solution: The resulting variable is just an air.File, and
    nativePath is accessible, as I expected. It just did nothing the
    first few times I tried it.

    Try this:
    SPPlatformFileSpecification spec;
    // do sADMBasic->StandardGetDirectoryDialog()
    ai::FilePath path;
    sAIFilePath->SetFromSPFileSpec(spec, path);
    Then talk to path to get your location. Hopefully that does the job. I've never used StandardGetDirectoryDialog() though, so for all I know its broken.

Maybe you are looking for