Page 1 of 1

after save

Posted: Wed Mar 07, 2018 1:06 pm
by johan
Hi

I want to add user_id and user_group_id in every record in my table clients.
I'm trying to do this with after save and I only want the update for new or cloned forms. But this doesn't work with this code. I think the problem is in the if part.

Code: Select all

if('#clone#' == '1' or '#RECORD_ID#' == '-1'){ 

$s = "UPDATE clienten SET cl_usergroup_id = '#USER_GROUP_ID#' ";
nuRunQuery($s);
}
Johan

Re: after save

Posted: Thu Mar 08, 2018 12:35 am
by admin
Johan,

I have updated Github with a change that should allow you to do this...

Code: Select all

if('#NEW_RECORD#' == '1'){ 

   $s = "UPDATE clienten SET cl_usergroup_id = '#USER_GROUP_ID#' ";
   nuRunQuery($s);

}
Let me know if it works for you.


Steven

Re: after save

Posted: Thu Mar 08, 2018 1:06 pm
by johan
Steven
Works perfect, thanks for your help.

Johan

Re: after save

Posted: Thu Mar 08, 2018 7:43 pm
by admin
.