0

I started by using PartyListForm in FindParty.xml. This list loads data related to parties, in my case with Supplier role. I added a new column with an ID from mantle.party.PartyIdentification, with specific partyIdTypeEnumId. The result is satisfactory, I have a list of Suppliers, with their names and respective IDs shown. The problem starts in the moment, when I want to let the user search through those IDs. It does not work. This is the definition of the column:

                <field name="idValue">
                    <header-field title="Company ID" show-order-by="true">
                        <text-find size="30" hide-options="true"/>
                    </header-field>
                    <default-field>
                        <display text="${partyIdentification?.idValue?:'N/a'}" text-map="partyIdentification"/>
                    </default-field>
                </field>

This is where the data (text-map="partyIdentification") comes from:

                <row-actions>
                    <entity-find-one entity-name="mantle.party.PartyDetail" value-field="party"/>
                    <entity-find-one entity-name="mantle.party.PartyIdentification" value-field="partyIdentification">
                        <field-map field-name="partyId" from="partyId"/>
                        <field-map field-name="partyIdTypeEnumId" value="PtidICO"/>
                    </entity-find-one>
                    <entity-find-count entity-name="mantle.party.PartyInvoiceDetail" count-field="invCount">
                        <econdition field-name="partyId" operator="equals" from="partyId"/>
                    </entity-find-count>
                </row-actions>

This is how it looks on the screen

@David's comment:

There is the original search commented out and my attempt:

        <!--<service-call name="mantle.party.PartyServices.find#Party" in-map="context + [leadingWildcard:true, orderByField:'^organizationName', roleTypeId:'Supplier', pageSize:7]" out-map="context"/>-->
    <service-call name="mantle.party.PartyServicesEnhancements.findEnhanced#Party" in-map="context + [leadingWildcard:true, orderByField:'^organizationName', roleTypeId:'Supplier', pageSize:7]" out-map="context"/>
mrovnanik
  • 123
  • 9
  • You showed your display code (including row-actions to look up the PartyIdentification record) but not the search code which is where you mention having a problem (this is typically under the screen.actions element). – David E. Jones Aug 05 '16 at 13:11
  • I added the code into the original message. – mrovnanik Aug 05 '16 at 13:31
  • Thanks for the hint, David. I managed to do it, I will post an answer, so that everybody knows. – mrovnanik Aug 05 '16 at 20:45

1 Answers1

0

I made a few changes by adding new components as a copy of existing ones, namely:

  1. new view-entity with entity-name="FindPartyViewEnhanced" in package="mantle.party as copy of "FindPartyView" with these additions:

    <member-entity entity-alias="IDNTF" entity-name="PartyIdentification" join-from-alias="PTY"> <key-map field-name="partyId" related="partyId" /> <entity-condition> <econdition field-name="partyIdTypeEnumId" operator="equals" value="PtidICO"/> </entity-condition> </member-entity>

    <alias entity-alias="IDNTF" name="idValue" field="idValue"/> <alias entity-alias="IDNTF" name="partyIdTypeEnumId" field="partyIdTypeEnumId"/>

  2. new service "findEnhanced" noun="Party" type="script" as a copy of find#Party service with new parameter added:

<parameter name="idValue"/>

  1. new findPartyEnhanced.groovy (copy of findParty.groovy) with a single line added:

if (idValue) { ef.condition(ec.entity.conditionFactory.makeCondition("idValue", EntityCondition.LIKE, (leadingWildcard ? "%" : "") + idValue + "%").ignoreCase()) }

  1. and finally, in the row actions of the screen, where the search is situated, this is what I ended up with:

<service-call name="mantle.party.PartyServicesEnhancements.findEnhanced#Party" in-map="context + [leadingWildcard:true, idValue:idValue, orderByField:'organizationName', roleTypeId:'Supplier', pageSize:7]" out-map="context"/>

Most probably, this is not the best solution, but it worked for me. Hopefully, it will help you as well.

mrovnanik
  • 123
  • 9