Skip to Content Skip to Menu

Auto Action on select field

  • autobahn
  • autobahn
  • OFFLINE
  • Posts: 202
  • Thanks: 38
  • Karma: 4
9 years 10 months ago #256112 by autobahn
Auto Action on select field was created by autobahn
I have a 'select' type CB field which has two values - Yes and No. I would like to use the onBeforeUserBlocking trigger to set this to No when a user is blocked.

I have tried using a Field type action with a Set Field operator to set the value to No but this does not work with a 'select' type CB field.

How can I achieve the required outcome?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48482
  • Thanks: 8283
  • Karma: 1443
9 years 10 months ago - 9 years 10 months ago #256166 by krileon
Replied by krileon on topic Auto Action on select field
Depends on how you're blocking the user. I suggest using the following.

Triggers: onAfterUserBlocking, onAfterUserUpdate, onAfterUpdateUser
Conditional: [block] Equal To 1

You can then use a field action or whatever action you like. This allows handling setting your field whether they're blocked from profile update or from the toggle. For example editing a user in backend and setting the blocked field to yes won't fire onAfterUserBlocking, but it will fire onAfterUpdateUser so you need to act on both to handle both usecases. The condition ensures your action only takes place if they're truly blocked.


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.
Last edit: 9 years 10 months ago by krileon.
The following user(s) said Thank You: autobahn

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

  • autobahn
  • autobahn
  • OFFLINE
  • Posts: 202
  • Thanks: 38
  • Karma: 4
9 years 10 months ago #256198 by autobahn
Replied by autobahn on topic Auto Action on select field
Thank you so much - exactly what I needed :cheer:

I have also been able to reverse the actions taken when the user is subsequently unblocked with a second Auto Action.

Auto Actions is a fantastic facility and I am slowly (oh so very slowly!) starting to understand how to use it.

Is there a full list of the triggers anywhere (for those of us not writing our own plugins)?

onAfterUserBlocking, onAfterUserUpdate and onAfterUpdateUser aren't on the dropdown list of triggers in CB 1.9 although they work fine.

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

  • heyai
  • heyai
  • OFFLINE
  • Posts: 324
  • Thanks: 79
  • Karma: 24
9 years 10 months ago #256200 by heyai
Replied by heyai on topic Auto Action on select field

autobahn wrote: Thank you so much - exactly what I needed :cheer:

I have also been able to reverse the actions taken when the user is subsequently unblocked with a second Auto Action.

Auto Actions is a fantastic facility and I am slowly (oh so very slowly!) starting to understand how to use it.

Is there a full list of the triggers anywhere (for those of us not writing our own plugins)?

onAfterUserBlocking, onAfterUserUpdate and onAfterUpdateUser aren't on the dropdown list of triggers in CB 1.9 although they work fine.


Here is quite a list: www.joomlapolis.com/support/tutorials/120-api-usage/18358-using-cb-triggers
I should watch this webinar and maybe some tutorials before I start playing with auto actions: vimeo.com/70504617

hey-ai - the community for asian guys and non-asian girls

The search bar is your friend, not just decoration!
The following user(s) said Thank You: krileon

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48482
  • Thanks: 8283
  • Karma: 1443
9 years 10 months ago #256257 by krileon
Replied by krileon on topic Auto Action on select field
Most of the triggers are on the following tutorial as heyai has linked, but I'll admit it is out of date. I'll be updating it at some point once I've got all the plugins up to date as with each CB 2.x plugin upgrade I've been adding new triggers to plugins and removing non-relevant ones.

www.joomlapolis.com/support/tutorials/120-api-usage/18358-using-cb-triggers

onAfterUserBlocking, onAfterUserUpdate and onAfterUpdateUser aren't on the dropdown list of triggers in CB 1.9 although they work fine.

Yeah the dropdown maybe out of date if you're not on CB 2.x as I've updated the trigger dropdown with CB 2.x release of CB Auto Actions. Regardless you can add whatever trigger you like to the input. The dropdown is just a quick-add feature, but you're not limited to what is on the dropdown.


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.

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

Moderators: beatnantkrileon
Powered by Kunena Forum