Custom profile field default value

14 years 1 month ago #126176 by roberto06
Custom profile field default value was created by roberto06
Hi everybody.
I'm new at using CB, and I was wondering how to set a default value to a custom profile field.

I created a field name 'Points', type integer, required, published in the profile, and readable only (no one excepted the administrator should edit this field).
I have also set the "Pre-filled default value at registration only" at 100, but when I register a new test user, the column cb_points in the table jos_comprofiler is NULL and not 100.

I guess I'll have to directly edit the code but I don't know which function in which file sends the values to the database after creating a user.

Can someone please help me ? (If you understood what I tried to explain :P)

Please Log in to join the conversation.

14 years 1 month ago #126254 by krileon
Replied by krileon on topic Re:Custom profile field default value
The default value at registration only works if the field is actually on the registration form. You would probably need a custom integration to ensure the field sets to 100 after registration. Your new CB plugin should utilize the onAfterUserRegistration trigger; please see tutorials in signature for further CB triggers usage.


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.

14 years 1 month ago #126319 by roberto06
Replied by roberto06 on topic Re:Custom profile field default value
Thx a lot, I'm gonna look at the tutorials right now;)

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.234 seconds

Facebook Twitter LinkedIn