[SOLVED] cb Query Plugin to run a query and based on result update another field

8 years 3 months ago - 8 years 3 months ago #276174 by pranaydhruv
Dear Team,

referring to my post below i have a question about how to use cb query :-

www.joomlapolis.com/forum/255-developer-members-support/232314-integrating-sms-gateway?start=12

i am trying to in-corporate a feature where when a user who had previously successfully verified their phone number and the value of their cb_phonenumberverified field is "yes" now have changed their phone number so this query will basically check if the old phone number is changed, if yes, then the value in field cb_phonenumberverified should be changed to "no" so that they have to re-verify their new number. Please suggest how i can implement this feature ?

Thanks
Pranay

Please Log in to join the conversation.

8 years 3 months ago #276181 by krileon
Act on the after profile update trigger and check that [var1_FIELD_NAME] is not equal to [var3_FIELD_NAME] under Conditionals. If they're not equal then the field value has changed as var1 is the new user object (after their changes) and var3 is the old user object (before their changes).


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 3 months ago #276209 by pranaydhruv
Dear Kyle,

This is what i tried in auto actions :-

1)Triggers - Onafteruserupdate
2)type- Field
3) Under conditions-> [var1_cb_phonenumber]not equal to [var3_cb_oldphonenumber]
4) Action-> field- cb_phonenumberverified
Operator- set(field=value)
Value-no

the issue is it updates the value of cb_phonenumberverified field to no even if i just update the profile without even changing the number.

Thanks
Pranay

Please Log in to join the conversation.

8 years 3 months ago #276253 by krileon
You need to compare the exact same field to see if it changed. So you'd have the below.

[var1_cb_phonenumber] Not Equal To [var3_cb_phonenumber]

I've no idea what cb_oldphonenumber field is or if you're updating it when cb_phonenumber changes properly.


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

Please Log in to join the conversation.

8 years 3 months ago - 8 years 3 months ago #276301 by pranaydhruv
Dear Kyle,

it is working now. Thanks!!


Thanks
Pranay

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.171 seconds

Facebook Twitter LinkedIn