Hi, I have a Custom Record Type (id is 'customreco...
# suitescript
f
Hi, I have a Custom Record Type (id is 'customrecord__dl_settings_name) containing few records. Columns are Name, ID, Name ID (id is 'custrecord__dl_settings_name_id'), Return Type, Parameter Type ans parameter Value. I want to make a suitelet which takes parameter as Name ID and search the whole record type to find a record with that Name ID. I am not able to find any API in N/record to do it, and in N/search it is not working. I tried to create search (search.create) but i do not know what to use as a 'type' .
Copy code
/**
 *@NApiVersion 2.x
 *@NScriptType Suitelet
 */

 define(['N/record','N/search'],
 	function(record, search){
 		function onRequest(context) {
            if (context.request.method === 'GET') {
		 		var obj = search.create({
		 			type: 'customrecord__dl_settings_name',
		 			id: 'customsearch_factory_search',
		 			columns: [{
		 				name: 'name'
		 			},
		 			{
		 				name: 'custrecord__dl_settings_param_id'
		 			},
		 			{
		 				name: 'custrecord__dl_settings_ret_type'
		 			},
		 			{
		 				name:'custrecord__dl_settings_name_id'
		 			},
		 			{
		 				name: 'custrecord__dl_settings_param_type'
		 			}],
		 			filters:[{
		 				name: 'custrecord__dl_settings_name_id',
		 				operator: 'is',
		 				values:['_faizal']
		 			}]

		 		}).run().each(function(result){
		 			log.debug(JSON.stringify(result));
      				return true;
		 		});
	 		}
	 	}
	 	return {
            onRequest: onRequest
        };
 	});
i
I think that your filter is wrong. "Is" operator is looking for an exact text but you are putting array as the value. Remove the brackets and leave only '_faizal_'