Hi Team, I have been trying to implement an auto action to update some fields in CB but it isn't working as expected.
Could you please have a look and let me know what I am doing wrong.
We have created text fields in CB that are being populated from another table to create read only fields to show in CB lists.
The format of the scripts need to be as in the images as the fields in the tables are integers and need to represent actual text results.
Global
There are no conditions
The Script in the Actions window is only one of a few. This script changes the value of say 1 to Active and so on.
Action
Output is none
Uses is 0
Params
I am currently running an update script in the database but require these fields to update automatically.
The List looks like this-
I have tried creating triggers in the database but they wont allow updating the table comprofiler.
So I'm back to trying to figure out how to make Auto Actions work with this.
I also have the query plugin installed and tried to create a query to just show a value in the list for a year of subscription but all entries where the same.
As this query to show which year the subscription was valid for.
Code:
SELECT
(
CASE WHEN ourtable_osmembership_subscribers.plan_subscription_from_date
BETWEEN '2018-03-01 00:00:00' AND '2019-03-01 00:00:00' THEN '2018 - 2019'
WHEN ourtable_osmembership_subscribers.plan_subscription_from_date
BETWEEN '2019-03-01 00:00:00' AND '2020-03-01 00:00:00' THEN '2019 - 2020'
WHEN ourtable_osmembership_subscribers.plan_subscription_from_date
BETWEEN '2020-03-01 00:00:00' AND '2021-03-01 00:00:00' THEN '2020 - 2021'
ELSE 'unknown'
END
)
FROM
ourtable_osmembership_subscribers
INNER JOIN ourtable_comprofiler ON ourtable_osmembership_subscribers.user_id = ourtable_comprofiler.user_id
WHERE ourtable_comprofiler.user_id = ourtable_osmembership_subscribers.user_id
but it only shows the value 2018 - 2019 in the lists
Kind Regards Adrian