cancel
Showing results for 
Search instead for 
Did you mean: 

Flexiquery Search to fetch order Model from DB

0 Kudos
461

Hi,

Using for loop, I am passing order codes one by one to fetch the OrderModel from DB through Flexible Search Query.

But the flexible search query is not working as expected, As only first time(first Loop) its fetch the Order Model, but from second loop, the flexible query return Order Model as null.

I debug the code and found that in DefaultFlexibleSearchService OOTB Class "jaloResult.getTotalCount() > 0" condition is not satisfied from 2 loop onwards.

Suggest how to resolved this issue, so that it will search all the valid orders from DB through Flexible Search Query.

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Deepak,

For getting list of orders from list of codes we can use the below query snippet.

 select {OrderModel.PK} from {OrderModel._typecode} where {code} in ('code1','code2','code3'......)

Its not required execute the flex query multiple times for diff codes.

Regards,

Raghavendra.

0 Kudos

Hi Raghavendra,

I also checked with the passing list of codes to the query, but again this returns only the Order Model for the first Order Code, and not for the remaining order codes.

Thanks

0 Kudos

Hi Deepak,

Please execute this query in hac and check, if its returning expected results in hac and its not returning in class means its due to lack of user privillages. Else you should check the order codes.

0 Kudos

Hi Raghavendra,

Found the reason why this is happening... actually while sending the list of order codes to fetch the order model... the order codes are separated by "comma" and after "comma" its appended a space.

Thanks Deepak