How do I concatenate fields in a lookup?

How do I concatenate fields in a lookup?

Step-by-step guide

 

  1. Click on Modules.

  2. Select the Module with the appropriate form field.

  3. Select the Forms tab.

  4. Select Field List button "Create/Update Fields".

  5. Use the filter to find relevant field.

  6. Select Edit on the field.

  7. Select Custom JavaScript tab.

  8. In the “filter” section type:

 

for (var i = 0, len = fieldScope.items.length; i < len; i++) {

               var item = fieldScope.items[i];

               if (!item.descriptionAppended) {

                   var separator = '-';

                   item.descriptionAppended = false;

                   //Check if the item has a description field, otherwise, use the customLongText1 field

                   //which is the description

                   var desc = item.description;

                   if (!desc) {

                       desc = item.customLongText1;

                   }

                   item.text = item.customString1+ separator + desc;

               }

           }

return fieldScope.items;

 

Related articles