[ 
https://issues.apache.org/jira/browse/OFBIZ-5256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13701283#comment-13701283
 ] 

Hans Bakker commented on OFBIZ-5256:
------------------------------------

That is indeed an interesting idea and i tried it with:

  <view-entity entity-name="InvoiceExport1" 
package-name="org.ofbiz.accounting.invoice">
        <member-entity entity-alias="INV" entity-name="Invoice"/>
        <member-entity entity-alias="PFR" entity-name="PartyIdentification"/>
        <member-entity entity-alias="PTO" entity-name="PartyIdentification"/>
        <alias-all entity-alias="INV"><exclude field="partyId"/></alias-all>
        <alias entity-alias="INV" name="partyIdFrom"/>
        <alias entity-alias="PFR" name="partyIdFromTrans" field="idValue"/>
        <alias entity-alias="INV" name="partyId"/>
        <alias entity-alias="PTO" name="partyIdTrans" field="idValue"/>
        <alias entity-alias="PFR" name="partyIdentificationTypeId1" 
field="partyIdentificationTypeId"/>
        <alias entity-alias="PTO" name="partyIdentificationTypeId2" 
field="partyIdentificationTypeId"/>
        <view-link entity-alias="INV" rel-entity-alias="PFR">
            <key-map field-name="partyIdFrom" rel-field-name="partyId"/>
        </view-link>        
        <view-link entity-alias="INV" rel-entity-alias="PTO">
            <key-map field-name="partyId" rel-field-name="partyId"/>
        </view-link>        
        <entity-condition>
            <condition-list combine="or">
                <condition-expr field-name="partyIdentificationTypeId1" 
value="INVOICE_EXPORT"/>
                <condition-expr field-name="partyIdentificationTypeId2" 
value="INVOICE_EXPORT"/>
            </condition-list>
        </entity-condition>
  </view-entity>

when i try this i get:

org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen 
[component://webtools/widget/EntityScreens.xml#FindGeneric]: 
java.lang.IllegalArgumentException: Error running script at location 
[component://webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.groovy]:
 java.lang.IllegalArgumentException: [InvoiceExport1]: Error in Entity Find: 
could not find field [partyIdentificationTypeId1] (Error running script at 
location 
[component://webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.groovy]:
 java.lang.IllegalArgumentException: [InvoiceExport1]: Error in Entity Find: 
could not find field [partyIdentificationTypeId1])
                
> allow a value in the view relation definition
> ---------------------------------------------
>
>                 Key: OFBIZ-5256
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5256
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: any
>            Reporter: Hans Bakker
>            Assignee: Hans Bakker
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: value.diff
>
>
> I need help from our framework experts.
> I want to copy invoices from an ofbiz system to other systems. However the 
> export has partyId's and productid's which are different on the other 
> systems. I want to use the product and party alternative id's to translate 
> these values.
> In order to be able to replace party and product id's values in a csv export 
> it is required to be able to have a 'value' specified instead of a field name
> the link in a view definition is as follows: (first key-map current, second 
> line new key-map possibility:
>       <view-link entity-alias="INV" rel-entity-alias="PFR" 
> rel-optional="true">
>             <key-map field-name="partyIdFrom" rel-field-name="partyId"/>
>             <key-map value="INVOICE_EXPORT" 
> rel-field-name="partyIdentificationTypeId"/>
>         </view-link>
> i will attach a diff for my implementation...
> Since we (Antwebsystems) focus on application development and not framework 
> development a check with our framework committers is highly appreciated.
> The patch includes a view which uses this new feature.
> Regards,
> Hans

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to