[SOLVED]Help

sc_redir not work.
No data inserted.
It only works when I put _blank.
neither works
sc_apl_conf (“AltaCliente”, “start”, “new”);

No data inserted.

thanks

If you use sc_redir in an event like onvalidate or before/after insert/update then you need to use sc_commit_trans(“Connection”) to store the updates. The second part just starts an application in insert mode. But that’s all…

I use onAfterInsert sc_redir at the event, and it works well when I use _blank target. Otherwise not working.

Code:
OnAfterInsert
$documento = [documento];
/**

  • Insert a record on another table
    */

// SQL statement parameters
$insert_table = ‘producto’; // Table name
$insert_fields = array( // Field list, add as many as needed
‘idcliente’ => “’$documento’”,

);

// Insert record
$insert_sql = ‘INSERT INTO ’ . $insert_table
. ’ (’ . implode(’, ‘, array_keys($insert_fields)) . ‘)’
. ’ VALUES (’ . implode(’, ', array_values($insert_fields)) . ‘)’;

sc_exec_sql($insert_sql);

sc_redir(AltaProductoVinculado,idcliente={documento}); // not working.
sc_redir(AltaProductoVinculado,idcliente={documento}, _Blank); // working.

thanks

have you tried _self _parent ?

If and fault equal.
Go to the other app but without inserting the data

even with the proposed commit? If you do a sc_redir you must do a sc_commit_trans();

Hello,

As Mr. Drent asked, are you commiting those data to your db?

regards,
Bernhard Bernsmann

Is solved I used sc_commit_trans () before redirecting and it works.
The strange thing that I have no use other applications that also works.
I imagine that will be a thing of the update.
By the way still does not work in onApplicationInit:
sc_apl_conf (“AltaCliente”, “start”, “new”);
It inserts the data, if it off if it works, it worked well before.
In order to have some patience

not working onApplicationInit:
sc_apl_conf (“app_clients”, “start”, “new”);

it was working before the last update

can someone help me?

Yes, please start a new thread with that …

🚀 Scriptcase 9.12 is now available! Check out the new features here 👉🚀 Next Monday (02/24), Scriptcase 9.12 will be released! Check out the new features before anyone else 👉