To do it, I tried the following PHP code in the AB (AfterBrowse) PHP of the lookup value:
Code: Select all
// Get the object type id
$recid = nuLookupRecord()->ID;
$s = "SELECT * FROM category WHERE category_id = '{$recid}'";
$t = nuRunQuery($s);
$r = db_fetch_object($t);
//nuDebug($r->category_countable);
if ($r->category_countable==1){
nuAddJavascript ("nuEnable('device_count');");
}else{
nuAddJavascript("nuDisable('device_count');");
}
nuEnable('device_count');
and
nuDisable('device_count');
work as expected when used in the LUJS but not when called from the PHP code.