Allowing multi selection search on a single select field

By | August 22, 2012

In Sage CRM, if we have created the field as selection, then it will allow us to select only single value globally on all screens. What if we want the field to be multiselect at the time of searching record through find page? For example, consider the field “Source” on New Case Screen which is a simple single selection field. Now at the time of searching cases we want this field to allow selecting the multiple options as well bring up search results accordingly.

Below are some easy steps to get your job done.
1. Create the multiselect field “case_sourcetype” and set the lookup family similar to the “case_source” as shown below.

2. Then put both the fields in the view that is being used for the search and list screen of cases.
3. Display case_sourcetype in the Search screen and case_source in the List screen of cases.
4. After that we need to ensure that both the fields (case_sourcetype and case_source) will have the same value all the time. This can be achieved by using the property of Table Level script as follows.
function InsertRecord()
{
//Handle insert record actions here
}
function PostInsertRecord()
{
//’set the value in the source
Values(‘case_sourcetype’)=Values(‘case_source’) + “,”;
}
function UpdateRecord()
{
// Handle update record actions here
//’set the value in the source
Values(‘case_sourcetype’)=Values(‘case_source’) + “,”;
}
function DeleteRecord()
{
//Handle delete record actions here
}
After the customization, a search screen will look like shown below. We can select multiple options in Source and click on Find button to find the related cases.