@@ -327,7 +327,8 @@ export class GridOdataService implements BackendService {
327327 if ( operator === 'IN' ) {
328328 // example:: (Stage eq "Expired" or Stage eq "Renewal")
329329 for ( let j = 0 , lnj = searchTerms . length ; j < lnj ; j ++ ) {
330- tmpSearchTerms . push ( `${ fieldName } eq '${ searchTerms [ j ] } '` ) ;
330+ const searchVal = searchTerms [ j ] . replace ( `'` , `''` ) ;
331+ tmpSearchTerms . push ( `${ fieldName } eq '${ searchVal } '` ) ;
331332 }
332333 searchBy = tmpSearchTerms . join ( ' or ' ) ;
333334 if ( ! ( typeof searchBy === 'string' && searchBy [ 0 ] === '(' && searchBy . slice ( - 1 ) === ')' ) ) {
@@ -336,7 +337,8 @@ export class GridOdataService implements BackendService {
336337 } else {
337338 // example:: (Stage ne "Expired" and Stage ne "Renewal")
338339 for ( let k = 0 , lnk = searchTerms . length ; k < lnk ; k ++ ) {
339- tmpSearchTerms . push ( `${ fieldName } ne '${ searchTerms [ k ] } '` ) ;
340+ const searchVal = searchTerms [ k ] . replace ( `'` , `''` ) ;
341+ tmpSearchTerms . push ( `${ fieldName } ne '${ searchVal } '` ) ;
340342 }
341343 searchBy = tmpSearchTerms . join ( ' and ' ) ;
342344 if ( ! ( typeof searchBy === 'string' && searchBy [ 0 ] === '(' && searchBy . slice ( - 1 ) === ')' ) ) {
@@ -349,7 +351,7 @@ export class GridOdataService implements BackendService {
349351 } else if ( fieldType === FieldType . string ) {
350352 // string field needs to be in single quotes
351353 if ( operator === '' || operator === OperatorType . contains || operator === OperatorType . notContains ) {
352- searchBy = this . odataQueryVersionWrapper ( 'substring' , odataVersion , fieldName , searchTerms ) ;
354+ searchBy = this . odataQueryVersionWrapper ( 'substring' , odataVersion , fieldName , searchValue ) ;
353355 if ( operator === OperatorType . notContains ) {
354356 searchBy = `not ${ searchBy } ` ;
355357 }
@@ -373,7 +375,7 @@ export class GridOdataService implements BackendService {
373375 // push to our temp array and also trim white spaces
374376 if ( searchBy !== '' ) {
375377 searchByArray . push ( searchBy . trim ( ) ) ;
376- this . saveColumnFilter ( fieldName || '' , fieldSearchValue , searchTerms ) ;
378+ this . saveColumnFilter ( fieldName || '' , fieldSearchValue , searchValue ) ;
377379 }
378380 }
379381 }
0 commit comments