CBSubs Integrations CB Fields - set value to expiry date?

6 years 10 months ago #295465 by cpaschen
I need to have the current subscription expire date visible via a cb field (for use with another extension).

I would like to use the Integrations - CB Fields to set a cb filed (cb_subs_expire) to the value of the expiration date of the subscription being purchased.

I tried setting the Operator to Set: Field = Value and then in the Value area I added [SUBSCRIPTION_EXPIRY_DATE]; however, it appears that this type of substitution doesn't work in this field.

Can you let me know if there is any type of substitution (possibly a different syntax) that would automatically insert the exipry date into the field or exactly what I can put in this value area (can I insert any type of formula - i.e. NOW()+365 etc.)?

Please Log in to join the conversation.

6 years 10 months ago #295466 by krileon
[SUBSCRIPTION_EXPIRY_DATE] should work fine, but believe it's already formatted. Try using a text field and see if that works.


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.

6 years 10 months ago #295474 by cpaschen
Unfortunately the other component needs in date format.

I've decided to just do this with direct code with a CLI solution.

Thanks.

Please Log in to join the conversation.

6 years 10 months ago #295486 by krileon
You could also use CB Auto Actions and its Field action with the below.

Plan Active
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
1: [var3] Equal To PLAN_ID_HERE
2: [var2] Equal To A

Plan Expired
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
1: [var3] Equal To PLAN_ID_HERE
2: [var2] Not Equal To A

To set the fields value to the expiration date of the subscription you'd need to use [var9_expiry_date], which will be SQL date formatted.


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

Facebook Twitter LinkedIn