Increment a User Field

8 years 9 months ago #268729 by Robcey
Replied by Robcey on topic Increment a User Field
Hi Kyle,
I much appreciate your help in providing the guidance.
The trigger hasn't thrown any errors, but, the field is not populating.
Are you able to shed any further light?
TIA
Rob

Please Log in to join the conversation.

8 years 9 months ago - 8 years 9 months ago #268732 by krileon
Replied by krileon on topic Increment a User Field
Ensure all FIELD_NAME references have been replaced with the actual field name. Ensure debug mode and maximum error reporting are both configured in Joomla global configuration during testing so errors can output. Also ensure CB Auto Actions is public and published in CB > Plugin Management. Aside from that, no I don't know why it's working as my direct test on phpmyadmin with values replaced works fine.


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 to join the conversation.

8 years 9 months ago #268882 by Robcey
Replied by Robcey on topic Increment a User Field
Hi Guy's,

I FINALLY got it to work.

The "After New User" trigger wasn't firing! Aaaarg?

Yes it's a rather brave statement, but, after hours of trying and testing I entered a very simple update statement to set the field with the value 8888, and got nothing.

After selecting "Click to Execute" in Global page of the Auto Actions, Kyle's update query worked. I then added as many triggers as possible that seemed related and one finally worked - namely "After Save User Registration".

Although it will work for most situations, could you please let me know of an alternative trigger for situation where I do not want to have the user as a Registered user.

BTW
Nick, thanks for the YouTube links. They helped to figure out a better solution for the Conditions.

Kyle, thanks for your help with the code. Like you I tried the query in phpmyadmin and the query did work. It's was the trigger that just never fired the code???

Also, after getting the Action to do what I wanted, I changed the trigger back to "Add New User" and it didn't work... Just needed to prove to myself that I didn't make a mistake earlier.

Cheers
Rob

Please Log in to join the conversation.

8 years 9 months ago #268891 by krileon
Replied by krileon on topic Increment a User Field
You need to be using the below triggers to change field values after registration stores for frontend and backend.

Triggers: After New User, After User Registration

After New User = Backend Registration
After User Registration = Frontend Registration

So depending on where you were testing it could appear 1 trigger isn't working if you selected only 1 of those triggers, but you need to select both.


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: nant

Please Log in to join the conversation.

8 years 9 months ago #269040 by Robcey
Replied by Robcey on topic Increment a User Field
Hi Kyle,

They are the triggers I had selected in the first place and getting no results when trying to add a user through the administrator back-end.

This is why I added the code setting the field to a value of 8888 - Because whatever the code the trigger should have populated the field - but didn't.

Is there a list of the triggers and whether they belong to the front-end or back-end?

Cheers
Rob

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.315 seconds

Facebook Twitter LinkedIn