Search CMSB Table - List Label Value

3 posts by 2 authors in: Forums > CMS Builder
Last Post: May 18, 2011   (RSS)

By rjbathgate - May 18, 2011 - edited: May 18, 2011

Hi,

I have TABLE A, which includes a few fields which are list driven (get options from database).

These list fields are set to store record num as the field value, and title as the field label (from TABLE B)

I have _all_ set for searching TABLE A in the section edition.

When looking at TABLE A in CMSB, and searching, it doesn't search the field label of these list fields, rather the num values.

Basically, I want to be able to use the search field to search TABLE A for the user-friendly label of these fields.

This is the first time I've ever noticed it, and it's causing problems -- does it always work like this, or have I got something strange going on?

In addition, SORTING seems to base itself on NUM rather than LABEL.

Cheers
Rob

Re: [rjbathgate] Search CMSB Table - List Label Value

By Jason - May 18, 2011

Hi Rob,

You're correct, CMS Builder does its searching based off the value of the field (in this case num) rather than the label. This is because only the value is actually stored in the database. The label is a value that's brought in just for display.

A good way to handle this is to use "advanced" searching to allow searching with drop downs for your list fields.

You put these lines under your _all_ line in your search box. For list fields, you can use the format:
fieldLabel|fieldName|match

For example, if you had a field called "brand" that was a list of brands brought in from a different section, you would use this:

Brand|brand|match

Now in your list view, if you click on "advanced search" you'll have a drop down box of brands that display your labels, but search on num.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/