[SOLVED] CB Action Field issue

6 years 8 months ago - 6 years 8 months ago #296353 by fede312
[SOLVED] CB Action Field issue was created by fede312
Hi:

I've created a CB action Type "Private Message" that sends a welcome PM to the user onAfterlogin with a popup, and it works great.
The issue is that it will send the PM every time the user logs in, in spite of the fact that I've setup a condition "only to be send if the field cb_welcomesent is Not Equal to 1". And even though "when the field is 1" the PM is sent anyway.

This is my setup:

CB Field Management

New Field
name: cb_welcomesent
type Checkbox (Single)

CB Auto Actions

1st action (Welcome Private Message)

Private Message Auto Action
Global
Type: Private Message
Triggers: onAfterLogin
User: Automatic
Access: Everybody
Conditions
cb_welcomesent Not Equal To 1

2nd action (Update cb_welcomesent_field)

Field Auto Action
Global
Type: Field
Triggers: onAfterLogin
User: Automatic
Access: Everybody
Conditions
cb_welcomesent Not Equal To 1

So when I login as the user with the cb_welcomesent Not checkmarked "no"
I've get the PM and the cb_welcomesent gets check marked to "yes"
I read the Message and Proceed to delete it.

When I logout and Log back In
I still get the PM even though the cb_welcomesent filed is check marked to "Yes"

What am I doing wrong?

Thank you,

Please Log in to join the conversation.

6 years 8 months ago #296362 by krileon
Replied by krileon on topic CB Action Field issue
Your condition ins't a valid substitution. It's literally comparing the text cb_welcomesent to 1 and since the text cb_welcomesent can never be 1 your condition always passes. You need to use proper substitution format for that to work such as [cb_welcomesent]. See the below for substitution usage information.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb

If you only want it to do this for the first login there's a trigger that fires only on first login that you could use instead. More specifically onAfterFirstLogin.


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

Please Log in to join the conversation.

6 years 8 months ago #296368 by fede312
Replied by fede312 on topic CB Action Field issue (solved)
I'm sorry!
You are right!!!
I forgot the brackets [ ]
Hahahahah!!!

This system is so powerful, I feel like a little kid with a new toy! :)
It works great now!

and yes the onAfterFirstLogin I will use for the 1st welcome message,
this was just an experiment to see if I could send targeted PMs,
and it obviously works great!

Thanks 1000
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.222 seconds

Facebook Twitter LinkedIn