Hi GP,

Can you try the operator in ? as like :
<field name="statusId_op"><hidden value="in"/> </field>

Nicolas

Le 05/03/2013 17:51, [email protected] a écrit :
Hi,

I am trying to change the "Find Requests" screen to be able to search by multiple status. A part of the change that I did for this on the UI is as shown below.

       <field name="statusId">
            <check allow-empty="true">
<entity-options entity-name="StatusItem" description="${description}"> <entity-constraint name="statusTypeId" operator="equals" value="CUSTREQ_STTS"/>
                    <entity-order-by field-name="sequenceId"/>
                </entity-options>
            </check>
        </field>

This renders the status as checkboxes, and with this change I am able to select multiple status for performing a search. The service linked to the "Find Requests" screen is performFind, which as I understand is a generic service used across ofbiz to find various entities.

<form name="ListRequests" type="list" extends="ListRequestList" list-name="listIt">
        <actions>
<service service-name="performFind" result-map="result" result-map-list="listIt">
            <field-map field-name="inputFields" from-field="parameters"/>
            <field-map field-name="entityName" from-field="entityName"/>
<field-map field-name="orderBy" from-field="parameters.sortField"/>
            <field-map field-name="viewIndex" from-field="viewIndex"/>
            <field-map field-name="viewSize" from-field="viewSize"/>
          </service>
        </actions>
    </form>

On debugging performFind, I found that when I select multiple status value to perform a find, the multiple status values translate into the following entity condition

statusId = '{CRQ_SUBMITTED, CRQ_ACCEPTED, CRQ_COMPLETED,CRQ_QUOATED}'

This will never return matching resultset since the multiple values are combined against a single condition. Ideally the conditions should be translated to multiple status values with OR logic, i.e. statusId= CRQ_SUBMITTED OR statusId=CRQ_ACCEPTED OR statusId=CRQ_COMPLETED OR statusId=CRQ_QUOATED.

Is there anyway I can achieve the above with minimum changes to performFind service for such scenarios.

The reason I am not inclined towards building a separate service for this behaviour as it would involve a greater impact to the overall stable functionality of "Find Requests".

Would greatly appreciate help on this from the community.

Regards
GP



--
Nicolas MALIN
Consultant
Tél : 06.17.66.40.06
Site projet : http://www.neogia.org/
-------
Société LibrenBerry
Tél : 02.48.02.56.12
Site : http://www.librenberry.net/

Reply via email to