Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

Updating Profile - Date field, not less than current date.

  • infovarep
  • infovarep
  • OFFLINE
  • Posts: 12
  • Thanks: 1
  • Karma: 0
11 years 1 month ago #233938 by infovarep
Hi, when Updating profile, I have a Tab with a Date field, where I don't want users to save a date equal or older than current.

How can I achieve it? I'd like to use Auto Actions, but if there's a easier solution, I'm open to it.

Thank you.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 1 month ago #233940 by krileon
Edit your date field and set "Minimum Year shown:" to 0. Then they have to always select current or greater than current year. I suppose you could use CB Auto Actions if you want, but it's easier to just limit the selection to current year.


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 or Create an account to join the conversation.

  • infovarep
  • infovarep
  • OFFLINE
  • Posts: 12
  • Thanks: 1
  • Karma: 0
11 years 1 month ago #233947 by infovarep
since I'm asking users to add expiration date in licenses, they can't add a license that already expired. I'd like to use auto actions, but I have a question on the dates conditional:

Type: Redirect
Trigger: onAfterUserUpdate
Access: Everybody
Conditional: [cb_mydate] Greater Than [LastLogin]
Redirect: page with error

In red is my idea of how could be done, but I don't know the substitution of last login.

and don't know if is going to work.

:blink:

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

  • infovarep
  • infovarep
  • OFFLINE
  • Posts: 12
  • Thanks: 1
  • Karma: 0
11 years 1 month ago - 11 years 1 month ago #233954 by infovarep
ERROR DOES NOT WORK - I solved it by using the next auto action configuration:

Type: Redirect
Triggers: onAfterUserUpdate
Access: Everybody
Conditional: [cb_expirationvob] - Greater Than - [cb:date format="m-d-Y" /]
URL: index.php/my-profile
Message: Your date is incorrect.

NOOO DIDN'T WORK :(
Last edit: 11 years 1 month ago by infovarep.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 1 month ago #233970 by krileon
You can't interrupt the profile store with a redirect, it's designed not to be interrupted by user cancel (browser navigation behavior). You have to log a plugin error to interrupt it using a Code action with Method set to PHP and using the below usage to force an error.

Code:
global $_PLUGINS; $_PLUGINS->_setErrorMSG( 'Your date is incorrect.' ); $_PLUGINS->raiseError( 1 );


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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum