How to change the contains of a field when another field is updated from FrontEn

4 years 7 months ago #314396 by scubabyss
I would like to create one or several autoactions that would set a field to "No" when a registered user update a profile field or when no file has been uploaded in a file field or when the uploaded file is replaced.

Can you explain how I can do that with Autoaction plugin ?

Thanks

Please Log in to join the conversation.

4 years 7 months ago #314422 by krileon
See below on how to trigger an action when a fields value changes.

www.joomlapolis.com/forum/153-professional-member-support/240617-solved-cb-autoaction-on-change-of-specific-user-fields#310923

As for acting on another field being set to "No" simply add an OR condition for that. Same applies for if the field is empty. So you'd have 3 OR conditions in total to cover your usage. If you want it to also apply to moderator profile edits or backend profile edits you'll also need to use the onAfterUpdateUser trigger.


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, scubabyss

Please Log in to join the conversation.

4 years 7 months ago #314440 by scubabyss
I will try. Thank you.

Please Log in to join the conversation.

4 years 6 months ago - 4 years 6 months ago #314451 by scubabyss
Thank's.
This is working as shown in the exemple.

What are the usage of the other Var_x ?

I have tried to reproduce the query exemple www.joomlapolis.com/images/stories/tutorials/uc001/aa-sql-block.png

It does not work. I have set trigger onupdateuser . Are your query syntax compliant with sql syntax ? I am surprise to see two type of ' in this exemple and not table jointure between users and comprofiler for the id=user_id

Sorry for my poor knowledge.

Please Log in to join the conversation.

4 years 6 months ago #314459 by krileon
The var# usages are to access the variables of a trigger. You need to be using the triggers onAfterUserUpdate and onAfterUpdateUser to cover backend and frontend user edits. var1 is the new user object and var3 is the old user object. This allows you to compare the new field value to the old field value so you can see if it changed. If you don't need to compare values you can just use [FIELD_NAME] substitutions.

For example if you've a checkbox field and you want to condition on that field being checked you'd use the below.

[FIELD_NAME] Equal To 1

For checkbox fields Yes (checked) is actually stored as 1 and No (unchecked) is actually stored as 0 or NULL. So it's best to condition Equal To 1 for checked and Not Equal To 1 for unchecked.


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.

Moderators: beatnantkrileon
Time to create page: 0.220 seconds

Facebook Twitter LinkedIn