Full Unique Record

2 posts by 2 authors in: Forums > CMS Builder
Last Post: February 5, 2013   (RSS)

By Steve99 - February 4, 2013

Hello,

I understand there is a way to set a field through the CMS Admin as "unique"... I was wondering if it is possible to set up validation within the CMS Admin for a full unique record.

Here is where I'm going with this... Knowing there is a way to set a field as "unique", is it possible to have the values of two fields concatenated and inserted into a separate field upon record save?

Example:

For "field1" I would enter "ABC"

For "field2" I would enter "XYZ"

"field 3" would be set to "ABCXYZ" upon record save (if unique - otherwise error message displays and record isn't saved)

Hopefully I explained this okay... In hopes of not causing confusion, I omitted a lot of additional information that would explain my reasoning for wondering if this is possible through the CMS Admin. Please let me know if further clarification is needed.

Thank you very much!

By gregThomas - February 5, 2013

Hi Steve,

There isn't a way to set up this functionality directly in CMS Builder. If you have any experience with creating plugins, it would be fairly simple to create one to do this. You would need to use the record_presave hook, and check $_REQUEST['menu'] to see which section is being edited and combine the data from field1 and field2 into field 3 if it's the right section.

We would be able to create this plugin for you, if you send an e-mail to consulting@interactivetools.com with the exact requirements, we can give you an estimate for the cost.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com