Automatic Value "Owner"

Wish to see a specific feature/change in future releases? Feel free to post it here, and if it gets enough "likes", we'd definitely include it in future releases!
Post Reply
SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Automatic Value "Owner"

Post by SkayyHH » 2015-05-13 22:12

Hello,

please make a auomativ value "owner" (owner of this record)

Thanks much, Kai

Satya Kavala
Veteran Member
Posts: 45
Joined: 2015-04-15 06:33
Location: Hyderabad
Contact:

Re: Automatic Value "Owner"

Post by Satya Kavala » 2015-05-15 06:41

Hi,
You mean that creating ownership to a record right?
Thanks&Regards
Satya Kavala
[email protected]

Satya Kavala
Veteran Member
Posts: 45
Joined: 2015-04-15 06:33
Location: Hyderabad
Contact:

Re: Automatic Value "Owner"

Post by Satya Kavala » 2015-05-15 06:50

Hi kai,
it may help you....

place the below code in after insert function of the related file in hooks folder

$qry="SELECT `groupID` FROM `membership_users` WHERE `memberID`='".$data['ClientID']."'";
$groupid=sqlValue($qry);
$qry2="INSERT INTO `membership_userrecords`(`tableName`, `pkValue`, `memberID`,`groupID`,`dateAdded`, `dateUpdated`) VALUES ('tablename','".$data['ID']."','".$data['ClientID']."','".$groupid."',UNIX_TIMESTAMP(now()),UNIX_TIMESTAMP(now()))";
sqlValue($qry2);


//here $data['ClientID'] is logged in member id
Thanks&Regards
Satya Kavala
[email protected]

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Re: Automatic Value "Owner"

Post by SkayyHH » 2015-05-16 20:30

Thanks much,

i´ll try it. But it would be better to have this from within the appgini app. I do not like the hooks. It´s confusing after you have some mods.

Thanks much, Kai

Ionut Bocanet
Posts: 28
Joined: 2017-03-12 09:26
Contact:

Re: Automatic Value "Owner"

Post by Ionut Bocanet » 2019-10-01 11:22

Satya Kavala wrote:
2015-05-15 06:50
Hi kai,
it may help you....

place the below code in after insert function of the related file in hooks folder

$qry="SELECT `groupID` FROM `membership_users` WHERE `memberID`='".$data['ClientID']."'";
$groupid=sqlValue($qry);
$qry2="INSERT INTO `membership_userrecords`(`tableName`, `pkValue`, `memberID`,`groupID`,`dateAdded`, `dateUpdated`) VALUES ('tablename','".$data['ID']."','".$data['ClientID']."','".$groupid."',UNIX_TIMESTAMP(now()),UNIX_TIMESTAMP(now()))";
sqlValue($qry2);


//here $data['ClientID'] is logged in member id
I want to update the ownership of a record by a value from a drop down field.

I tried this code and replaced the ClientID with my own dropdown field but in the ownership table i have blank in owner field.
Best Regards,
Ionut Bocanet

Post Reply