Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

after save

Questions related to using nuBuilder Forte.
Locked
johan
Posts: 422
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

after save

Unread post 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
admin
Site Admin
Posts: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: after save

Unread post 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
johan
Posts: 422
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: after save

Unread post by johan »

Steven
Works perfect, thanks for your help.

Johan
admin
Site Admin
Posts: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: after save

Unread post by admin »

.
Locked