Skip to Content Skip to Menu

[SOLVED] AutoActions: Updating fields in other users

  • peli_m
  • peli_m
  • OFFLINE
  • Posts: 54
  • Thanks: 6
  • Karma: 0
9 years 6 months ago - 9 years 6 months ago #276925 by peli_m
Hello,

Sorry but I'm lost with AutoActions. I'm using connections to relate families and works fine. All members of a family have a field cb_family with a common key for this family. In front-end edit mode, when a father change their own field cb_address, I would like all members of this family change their cd_address field too. How?

Thank you
Last edit: 9 years 6 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 49441
  • Thanks: 8467
  • Karma: 1465
9 years 6 months ago #276932 by krileon
Replied by krileon on topic AutoActions: Updating fields in other users
Query action on the after profile update trigger could work. You'd use conditionals to compare var1 and var3 values to ensure the field actually changed. Example as follows.

[var1_FIELD_NAME] Not Equal To [var3_FIELD_NAME]

Then you'd update all field values of profiles from the old to the new query a query. Example as follows.

Code:
UPDATE `#__comprofiler` SET `FIELD_NAME` = '[var1_FIELD_NAME]' WHERE `FIELD_NAME` = '[var3_FIELD_NAME]' AND `user_id` != '[user_id]'

Better option would be to just not use those fields if the account isn't head of household. Instead you could query for those values using CB Query Field or try substituting them in using the Layout parameters for those fields or a Custom HTML field. Everything depends on how you've set up the relationship between head of household and other family members though.


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

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

  • peli_m
  • peli_m
  • OFFLINE
  • Posts: 54
  • Thanks: 6
  • Karma: 0
9 years 6 months ago #276939 by peli_m
Replied by peli_m on topic AutoActions: Updating fields in other users
Great! It worked at the first try. The children are unable to edit this field, only the father can do it. It's exactly what I wanted.

Thank you for your fast and effective support

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

Moderators: beatnantkrileon
Powered by Kunena Forum