Widget Document Suggestion how to query on two fields?

Hello,

In my layout I would like to be able to search a document but be able to search either on its name or on its code. I tried several things with the nxql query but couldn't make it work. I thought about the javascript formatter but I think it wouldn't help me search on both field.

Here's what I tried: SELECT * FROM myDocType WHERE dc:title = '%?%' OR mySchema:code = '%?%'

but obviously it's not working. I get an empty response from the servor. Would you have any idea how to achieve this ? Or if it's even possible ?

Thanks

0 votes

1 answers

1808 views

ANSWER



You can use your widget's custom parameter : “operationId” and set its value to the name of your contributed custom operation. There is an example with javascript automation here : https://www.nuxeo.com/blog/fun-suggestion-widget-javascript/

0 votes