[SOLVED] Auto Actions - Update one field to update multiple fields

5 years 7 months ago - 5 years 7 months ago #306615 by webtechplus
Good morning we have a feature we are trying toi get woring and at present we are not having much luck, can someone point us at where we have gone wrong...

At present when we update a profile its not executing...

What we are trying to do is this;
Update one field in the clients profile, this will then trigger an update on 3 other tables on save.

Triggers
onAfterNewUser, onAfterUpdateUser, onAfterUserRegistration, onAfterUserUpdate, activity_onAfterUpdateAction

Conditions
Value = bc_clanrank
Operator = Equal To
Value = SIBKIN

Action
Field = cb_ranksort2
Operator = Set (Field = Value)
Value = P Sibkin
Translate = No
Save Directly = Yes
User = Blank

Field = cb_rank
Operator = Set (Field = Value)
Value = /images/NewRanks/sibko.jpg
Translate = No
Save Directly = Yes
User = Blank

Output
Display = echo
Layout = <h2>Member Rank Updated to SIBKIN</h2>
Method = HTML
Translate = No
Substitutions = No
Format Functions = No
Content Plugins = No

Parameters
Reload User = Yes
Exclude Users = Blank
Translate = Yes
Substitutions = Yes
Format Functions = No
Content Plugins = No
References = Default
Loop = Select Variable
Debug = No


Thanks for support and feedback
We hope that we can assist you if you need and ask, all the best from the WTP Team

Please Log in to join the conversation.

5 years 7 months ago #306619 by krileon
Your condition will always fail. cb_clanrank isn't a valid substitution and is just a string. Currently it's just checking if the literal string cb_clanrank is equal to SIBKIN, which it's not so will always fail. It has to be surrounded with brackets for it to be parsed as a substitution so likely will work fine once changed to [cb_clanrank].

If you're wanting this to happen at time of registration and profile update then your triggers are fine except activity_onAfterUpdateAction, which is fired when an Action in backend is saved and should be removed.


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

Please Log in to join the conversation.

5 years 7 months ago - 5 years 7 months ago #306652 by webtechplus
Thanks that worked straight away.
The only issue now is the images, can we refer to an image in the images location?

That is the only thing that does not appear to be working at this stage, and i suspect its cause its not loaded withing the Community Builder folder structure?

Action
Field = cb_rank
Operator = Set (Field = Value)
Value = [img src="/images/NewRanks/sibko.jpg" alt="Sibkin"]
Translate = No
Save Directly = Yes
User = Blank

The other thing we have noted is that there is not a huge loaded to the server when you save a user account, to the point the administrator area tab crashes, and will not reload.


Thanks for support and feedback
We hope that we can assist you if you need and ask, all the best from the WTP Team

Please Log in to join the conversation.

5 years 7 months ago #306666 by krileon
Not sure why that is necessary. You're trying to set cb_rank to some HTML based off the value of cb_clanrank? You should be able to just use a Custom HTML field and some IF substitutions to accomplish that. Example as follows.

[cb:if cb_clanrank="SIBKIN"]<img src="/images/NewRanks/sibko.jpg" alt="Sibkin" />[/cb:if]

This avoids having to store any additional information in the database and avoids needing to use an auto action entirely.


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.

5 years 7 months ago #306669 by webtechplus
Krileon, the reason why i am writing the separate commands is when a member is promoted its a manual process there is a test to acheive rank.
So the issue we are having is that i have had to create each one for each rank...

When a Person applies to join they do not have a rank of sibkin you have to prove you can earn even that rank.


Thanks for support and feedback
We hope that we can assist you if you need and ask, all the best from the WTP Team

Please Log in to join the conversation.

5 years 7 months ago #306671 by krileon
That doesn't have anything to do with the Custom HTML usage. It's conditioning its display based off your cb_clanrank field using the same condition you're applying to your auto action. So if cb_clanrank is set to SIBKIN it'll display your image otherwise it won't. You don't need an auto action for that behavior and I don't recommend using one.


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.221 seconds

Facebook Twitter LinkedIn