Tuesday, September 10, 2013

Auto Generated Codes for Users etc in BlueBox

In BlueBox2.0 we have a bbsetting called bbsetting_autogen_alphanum_fields which allows you to define the auto-generation of 'code' fields for data that is added to a module.

A typical application of this would be the bb_users table where the 'code' field may need to be autogenerated. If this is the case, then using module settings (data-functions>module settings in the desired module), set bbsetting_autogen_alphanum_fields as follows.

A comma separated list of field names and their desired prefixes:

{field_name}={prefix},{second_field_name}={prefix} etc

If you require the prefix to be auto-created from data that is submitted, then use square brackets with the field/s required separated by |'s pipes).

So, a real-world example would be, to set the 'code' field in the bb_users table to use the company name or the last name (if company name is not entered)

code=[company_name|last_name],

No comments:

Post a Comment