Need to add some filter conditions

vinuth v
Tera Expert

Hi All,

 

I need to add some filter conditions to one of the field that is "Hardware asset" and it is referring to alm_hardware table.

Filter conditions: Model category is computer and Model is not Virtual and assets state is In use or In stock.

I have added some filter condition like this:

 

asset.query('model!=307716f5db30605042e8d2e3ca9619ce^model_category=81feb9c137101000deeabfc8bcbe5dc4^install_status=1^ORinstall_status=6');

But I am getting other assets also,

vinuthv_0-1690191217874.png

 

Please any one provide me the inputs,

 

Thanks in advance,

Vinuth

2 REPLIES 2

Harish KM
Kilo Patron
Kilo Patron

Hi asset.query('model!=307716f5db30605042e8d2e3ca9619ce^model_category=81feb9c137101000deeabfc8bcbe5dc4^install_status=1^ORinstall_status=6');

 

replace to

asset.addEncodedQuery('model!=307716f5db30605042e8d2e3ca9619ce^model_category=81feb9c137101000deeabfc8bcbe5dc4^install_status=1^ORinstall_status=6'); //you need to use encoded query here

Regards
Harish

Nitesh A
Tera Expert

Hello,

 

Instead of asset.query('<your_query>') use asset.addEncodedQuery('<your_query>');

 

Please mark this response as correct or helpful if it assisted you with your question.

Regards,
Nitesh