Dear all,
I have to solve this matter becouse it’s blocking me.
I did a single record master form and two detail forms .
In the master form I have a name of user and if the select count give me a result >0 on the form table means that I have to hide the “New” button.
Otherwise the user has still no registration and so I can show the new button.
I’ve founded “sc_apl_conf” macro but probably within “onchange Ajax event” they do not work.
Onchange code
// SQL statement parameters
// Check for existing record
$check_sql = “SELECT COUNT(*) FROM med_therapy_m WHERE med_therapy_m.user_id = {user_id}”;
sc_lookup(dataset, $check_sql);
$check_flag = {dataset[0][0]};
echo “CFlag ON Change” .$check_flag;
IF ($check_flag > 0)
{
sc_apl_conf(“form_med_therapy_m”, “insert”, “off”) ;
sc_apl_conf(“form_med_therapy_m”, “add”, “off”) ;
}
I’m stucked and I’ve no idea how to conditional hide the button. Any suggestion will be very hepful.