Good morning,
I think it is my first post …
My name is Michele from the low Friuli Venezia Giulia - Italy. Passionate about PHP programming and SQL as an alternative hobby …
I hope I have looked for good, in the forum, before posting this request, but I had not found anything in my case, otherwise I apologize right now.
I’m posting this request because I can not understand, and to find a solution about this problem:
in a grid which extracts the data in a MySQL table “table2” I added a run button as indicated here.
to copy the records selected through the relevant checkbox, in another table: “table1”.
The configurations in the “table2” are as follows:
Events>onApplicationInit:
[I] = 0;
[total_chked] = array();
On button:
OnRecord:
[I]$arr=[i];
[total_chked][$arr]={idtable2};
++;
OnFinish:
As Indicate here.
if(count([total_chked]) > 0)
{
$to_copy = “(”.implode(’,’,[total_chked]).")";
sc_exec_sql("INSERT INTO table1 (idtable1, field1, field3, field4) SELECT Null, field6, field8, field10 FROM table2 WHERE idtable2 IN ".$to_copy);
}
Premises to the problem:
It states that the application runs after a user login and then through the security module created from the “Forms”> “Security” as Type: Application.
The problem:
Step 1:
I run the application, and I select the records you want to copy in “table1” through its checkbox, then I click on the “Run” button and successfully copies the record …
Step 2:
Now, the application remains open and copy other records (for the second time), of course, different from those copied in Step 1.
The system copies the selected ones selected records and copied in Step 1.
Ambiguous solutions:
I have to log out or a macro to redirect (sc_redir) in another application.
Sincerely “ambiguous” solutions would be a bit annoying and time-consuming for the user, because it just so happens that a user might have forgotten to “copy” other records and insert them immediately after the copy of the background, without leaving by app.
Some kindly help?
Thanks in advance!