Hi
I have 2 list with more fields, list have same table as bind (proiecte) and use ID as (primary key).
Data from list 1 have one field active = 1 and list2 have same fild active = 0
What i want is to move from active list to inactive list and set active to zero (0) or one (1) depending of the case.
Just move 1 row from active to inactive (using javaaction) and submit i sow de sql is to insert data in table with ID key.
I try to interfer with it changing values of e.sqlArgs and e.sqlInsert on function beforeRecordInsert.
And I fail.
Is any way to update only that field only when i submit?
Or maybe is wrong my way i want to do that?
Here is what is on beforeRecordInsert function
Screenshot 2013-12-24 22.58.30.png
I have 2 list with more fields, list have same table as bind (proiecte) and use ID as (primary key).
Data from list 1 have one field active = 1 and list2 have same fild active = 0
What i want is to move from active list to inactive list and set active to zero (0) or one (1) depending of the case.
Just move 1 row from active to inactive (using javaaction) and submit i sow de sql is to insert data in table with ID key.
I try to interfer with it changing values of e.sqlArgs and e.sqlInsert on function beforeRecordInsert.
And I fail.
Is any way to update only that field only when i submit?
Or maybe is wrong my way i want to do that?
Here is what is on beforeRecordInsert function
Code:
function beforeRecordInsert dim sql_insert as c ' what sql look like dim args as sql::arguments ' arguments for sql args.xml = e.sqlArgs.xml ' get xml from arguments dim id as n ' how many arguments on list id = e.sqlArgs.Count if (id > 0) then if (args[id].data = "") then args[id].isNull = .t. end if end if sql_insert = e.sqlInsert; ' get sqlInsert on my own variable sql_argumente = e.sqlArgs; 'INSERT INTO proiecte (id) VALUES (:proiecte_id) - here is how it looks the sqlInsert 'what i want to do 'UPDATE proiecte SET activ = 0 WHERE id = 31; e.sqlInsert = "UPDATE proiecte SET activ = 0 WHERE id = " + args[1].data end function
Comment