Announcement

Collapse
No announcement yet.

Popup ID number after update

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Popup ID number after update

    Hi!

    I create a form to use for our reference number and I create the ID as auto increment.
    I need to popup the ID generated when i click the "Add new" which is also means save.


    Hope you can help me.

    Thanks!

  • #2
    Hello,
    if your primary key is named customer_id
    you will get the value in the OnAfterInsert Event using
    $last_id = {customer_id};

    That's all.

    Best regards
    Uwe

    Comment


    • #3
      Originally posted by Pfeiffer View Post
      Hello,
      if your primary key is named customer_id
      you will get the value in the OnAfterInsert Event using
      $last_id = {customer_id};

      That's all.

      Best regards
      Uwe

      Hi! Thanks for your help!

      Anyway, I am just new in this program.

      What I did is i insert $last_id = {customer_id}; in OnAfterInsert event, am i right?

      but it doesn't do anything.

      What Im trying to achieve is, I want to popup the generated ID number after I insert data.

      Thanks !

      Comment


      • #4
        it's not very easy to make a popup at the onafterinsert event. sc_alert is not valid here. But you can try to use sc_error_message($error_message); which will give some kind of popup. Another option can be to create a javascript function my_alert and use sc_ajax_javascript($javascript_function, $javascript_parameters);

        Documentation can be found in the macro's section of the scriptcase helpfile.
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment

        Working...
        X