Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

CB Auto Actions/CB Subs SQL on registration.

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
8 years 10 months ago #275334 by timstohr
Hi,

I have a component that is annoyingly always asking for a choice between employer and Job seeker.

I think it would be possible but not completely sure yet (also I have now understood that CB Subs contains CB Auto Actions and thus both should be reasonably similar in function).

Can I add upon Registration (OnAfterRegistration) an Auto action that changes in SQL that user gets registered as JOB SEEKER (I would then simply set all the existing users as Job Seekers as well by triggering it manually)

In CB Subs, I would like to add a subscription which triggers an SQL change that marks the user as EMPLOYER.

Would work in theory no?

Please Log in or Create an account to join the conversation.

  • nphic
  • nphic
  • OFFLINE
  • Posts: 203
  • Thanks: 25
  • Karma: 1
8 years 10 months ago #275338 by nphic
Tim,

I do something similar with our membership. On the Integrations / SQL Actions for the specific plan, I set default values for a user when they Activate (New User). In the SQL Action 1 area and in the Activation box, I have the following SQL code:

UPDATE xxxxx_comprofiler a
SET
a.cb_role = "None",
a.cb_ccph = "No",
a.cb_agencytype = "None",
a.cb_mbranniversary = CURDATE(),
a.cb_membershiplevel = "Government Individual",
a.cb_mbrtype = "Member"
WHERE
a.user_id = [user_id];

Make sure you have the CBSubs SQL actions installed in Community Builder and they are published. Hope this helps.

Thanks,
Joe

Please Log in or Create an account to join the conversation.

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
8 years 10 months ago #275340 by timstohr
Replied by timstohr on topic CB Auto Actions/CB Subs SQL on registration.
Awesome, thanks Joe.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48464
  • Thanks: 8280
  • Karma: 1443
8 years 10 months ago #275349 by krileon
Replied by krileon on topic CB Auto Actions/CB Subs SQL on registration.
If you're changing a field use a Field action in CB Auto Actions to do this or in CBSubs use CBSubs Fields. I do not recommend direct database queries for changing field values.

CB Auto Actions has an Internal > Users trigger that can loop the action for every user or for the specified user ids. This can be used for your mass processing functionality.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: timstohr

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum