@@ -30,7 +30,7 @@ function createFilter(options) { // eslint-disable-line no-unused-vars
30
30
* @returns {object } resultset
31
31
*/
32
32
function ResultSet ( ) {
33
- const privateColumns = this . columns || { } ;
33
+ const privateColumns = this . columns || [ ] ;
34
34
const times = this . type === 'customrecord_mycs_script_settings' ? 1 : Math . floor ( Math . random ( ) * 99 ) + 1 ;
35
35
const mockupData = _ . map ( _ . times ( times ) , item => ( {
36
36
id : item + 1 ,
@@ -104,6 +104,23 @@ function ResultSet() {
104
104
} ;
105
105
}
106
106
107
+ /**
108
+ * NetSuite new column
109
+ * @param {* } options
110
+ * @returns {string }
111
+ */
112
+ function createColumn ( options ) {
113
+ return `${ options . name } ${ options . join ? '__' + options . join : '' } ` ;
114
+ }
115
+
116
+ /**
117
+ * NetSuite new filter
118
+ * @param {* } options
119
+ * @returns {string }
120
+ */
121
+ function createFilter ( options ) { // eslint-disable-line no-unused-vars
122
+ return `${ options . name } ${ options . join ? '__' + options . join : '' } ` ;
123
+ }
107
124
/**
108
125
* NetSuite - constructor of search module.
109
126
* @param {* } options_
@@ -145,10 +162,13 @@ module.exports = {
145
162
createColumn : options => createColumn ( options ) ,
146
163
lookupFields : ( options ) => {
147
164
const result = { } ;
148
- options . columns . map ( ( item , index ) => {
149
- result [ item ] = [ { value : index , text : item } ] ;
150
- return true ;
151
- } ) ;
165
+ if ( Array . isArray ( options . columns ) ) {
166
+ options . columns . map ( ( item , index ) => {
167
+ result [ item ] = [ { value : index , text : item } ] ;
168
+ } ) ;
169
+ } else if ( typeof options . column === 'string' ) {
170
+ result [ options . column ] = [ { value : Math . floor ( Math . random ( ) * 10000 ) , text : options . column } ] ;
171
+ }
152
172
return result ;
153
173
} ,
154
174
Type : {
0 commit comments