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!

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

[QUOTE=Pfeiffer;20368]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[/QUOTE]

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 !

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.