Line 472:
Line 472:
By default, the prefix is "cf_", so if you have a custom field named "user_ref" you will get "cf_user_ref".
By default, the prefix is "cf_", so if you have a custom field named "user_ref" you will get "cf_user_ref".
−
This behaviour can easily be changed by editing the $varprefix value in /htdocs/customfields/class/customfields.class.php (it's at the beginning of the file, just after "class CustomFields").
+
This behaviour can easily be changed by editing the general configuration file for CustomFields located inside /htdocs/customfields/conf/conf_customfields.lib.php.
+
+
Then edit the value of the '''$fieldsprefix''' variable.
+
+
== Changing the delimiter for Smart Value Substitution ==
+
+
When using smart value substitution (ie: when you create a constrained field and set remote columns names in the field's name), by default every column name must be separated by an underscore '_'. This is usually good enough for most cases, but in a few occasions you might want to link to a remote column which name already contains an underscore, and in this case you won't be able to access it with SVS (but you can still access it with the remote field access in PDF/ODT templates and PHP codes, eg: myfield_remote_field_name_with_underscore).
+
+
If you want to change the default delimiter, you can easily do so by editing the general configuration file for CustomFields located inside /htdocs/customfields/conf/conf_customfields.lib.php
+
+
Then edit the value of the '''$svsdelimiter''' variable to any value you want.
+
+
Note: You can set single characters as well as multiple characters for the svsdelimiter. Eg: $svsdelimiter='__'; will allow you to make a constrained field myfield__firstname__name on llx_users and linked to both the firstname and name columns from the llx_users table.
+
+
'''CAUTION''': you can only set as a delimiter a character that is accepted by your DBMS, or else this will produce errors! eg:
== Overloading functions: Adding your own management code for custom fields ==
== Overloading functions: Adding your own management code for custom fields ==