This topic is locked

DAL ADD METHOD don´t show error

9/8/2016 2:47:16 PM
PHPRunner General questions
F
fabiofurlan author

when use specific button to eg add a record via DAL with ADD method and random data generate duplicate key in a UNIQUE index in the mysql database does not include the record but also shows no error on page PHP
example:

$tblx_protheusmenu = $dal->Table("x_protheusmenu");

$tblx_protheusmenu->Value["XPRM_EMPRESA"] = $empresa; //$_SESSION["EMPRESA_COD"];

$tblx_protheusmenu->Value["XPRM_MENU"] = $matrizmenu[$i][1];

$tblx_protheusmenu->Value["XPRM_MODULO"] = substr(substr($matrizmenu[$i][1],-8),1,3);

$tblx_protheusmenu->Value["XPRM_TIPO"] = $matrizmenu[$i][0];

$tblx_protheusmenu->Value["XPRM_NIVEL"] = $matrizmenu[$i][2];

$tblx_protheusmenu->Add();

Sergey Kornilov admin 9/8/2016

Button's PHP code is executed behind the scene via AJAX. Any output that happens in button's code like error message won't be visible on the page.
Check this for more info:

https://xlinesoft.com/phprunner/docs/troubleshooting_custom_buttons.htm