assign records to groups on import

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
bescott53

assign records to groups on import

Post by bescott53 » 2017-03-01 10:06

Is there a way to assign records I am importing on a schedule in mysql to groups based on the value in a column in the data I am importing?

bescott53

Re: assign records to groups on import

Post by bescott53 » 2017-03-09 10:59

Any ideas on this board?

AhmedBR
AppGini Super Hero
AppGini Super Hero
Posts: 327
Joined: 2013-09-19 10:23

Re: assign records to groups on import

Post by AhmedBR » 2017-03-09 20:01

I use the following in ini hook:

In my case I use a field called Group where I assign the Group Number and that number is used to assig the user records automatically
Anytime the Group is changed it is assigned to the new group.


sql("UPDATE membership_userrecords
left join Delivery
on YOURTABLE.ID = membership_userrecords.pkValue
set membership_userrecords.groupID = YOURTABLE.Group
where membership_userrecords.tableName = 'YOURTABLE' ",$eo);

You can go from here.
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper

bescott53

Re: assign records to groups on import

Post by bescott53 » 2017-03-14 10:40

thanks AhmedBR, I am looking for a file called ini hook, but I don't have it? Do you know where this would go?

AhmedBR
AppGini Super Hero
AppGini Super Hero
Posts: 327
Joined: 2013-09-19 10:23

Re: assign records to groups on import

Post by AhmedBR » 2017-03-14 18:38

it is init (not ini, the t must have fallen) hook is a function in EVERY file (each table has one) in the HOOK folder.

Take a look at this tutorial about using hooks:
https://bigprof.com/appgini/help/advanc ... ename_init
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper

Post Reply