Page 1 of 1
I wrote this code but the lines do not appear related
Posted: Tue Mar 14, 2017 8:59 pm
by saleh
I have a table estmarh
I need:
Identity_moder=Identity
Identity in ( SELECT * FROM users WHERE = Identity )
I need all the lines in which moder=Identity And it is associated with Identity Show Level 2
I wrote this code but the lines do not appear related
Is it possible to correct code
// UserID Loaded event
function UserID_Loaded() {
//echo "UserID Loaded: " . $this->UserIDList() . "<br>";
global $Page;
if ($Page && $Page->TableName == "estmarh" && CurrentUserLevel() == "2" && ew_AddFilter($filter, " Identity_moder == SELECT * FROM users WHERE = Identity ") ) {
$this->AddUserID(-1);
}}
thank you
Re: I wrote this code but the lines do not appear related
Posted: Tue Mar 14, 2017 9:45 pm
by mobhar
Wrong code. You cannot use "ew_AddFilter" function in "UserID_Loaded" server event.
Re: I wrote this code but the lines do not appear related
Posted: Wed Mar 15, 2017 1:08 am
by saleh
He worked View :
Information appears correctly, but when added show a problem
Failed to execute SQL. Error: The target table estmarh_moder of the INSERT is not insertable-into
SELECT DISTINCT estmarh.*
FROM estmarh
JOIN users ON estmarh.SchID = users.SchID
WHERE (estmarh.SchID = users.SchID)
Re: I wrote this code but the lines do not appear related
Posted: Wed Mar 15, 2017 12:23 pm
by mobhar
Search for keyword "UpdateTable" in this forum for your references about how to insert data into Database View that joins more than one table.
Re: I wrote this code but the lines do not appear related
Posted: Wed Mar 15, 2017 2:48 pm
by saleh
The problem ended Status :UpdateTable
1-
// Row Updating event
function Row_Updating($rsold, &$rsnew) {
// Enter your code here
// To cancel, set return value to FALSE
$this->UpdateTable = "estmarh";
}
2-
// Row Inserting event
function Row_Inserting($rsold, &$rsnew) {
// Enter your code here
// To cancel, set return value to FALSE
$this->UpdateTable = "estmarh";
return TRUE;
}
Thank you so much