Login  Register

Re: Complex View not working

Posted by David E Jones on Apr 07, 2008; 7:38pm
URL: http://ofbiz.116.s1.nabble.com/Complex-View-not-working-tp135037p135039.html


To have two different "instances" of an entity in a view-entity you  
need to member entities with different aliases.

-David


On Apr 7, 2008, at 11:00 AM, Mark Ellul wrote:

> I just read my post and I wanted to make it more obvious..
>
> Basically I have 2 different partyIds in a view and I want to link  
> to the
> Person to each partyId and put their Names.
>
> So I can see the name of the submission of the CustRequest and the  
> name of
> each person who plays a role in that CustRequest.
>
> For some reason whenever I try to do this, I can only use a view-
> link once
> for the Person Table.
>
> Any help would be appreciated!
>
> Regards
>
> Mark
>
>
> On Mon, Apr 7, 2008 at 4:39 PM, Mark Ellul <[hidden email]>  
> wrote:
>
>> Hi,
>>
>> i am trying to create a view which uses the CustRequestAndRole  
>> view...
>>
>> What I want is:
>> 1. to have the firstName and LastName of the person linked to the
>> fromPartyId - So I know whos request it is...
>> 2. to have the firstName and LastName of the person linked to the  
>> partyId
>> - So I know the name of the person who fulfils the role.. i.e the  
>> manager of
>> the request...
>>
>> I can get number 2 working with the below...
>>
>>    <view-entity entity-name="CaseSummaryAndRoleView"
>>            package-name="com.catalystic.iodine.crm"
>>            title="Case Summary View Entity">
>>      <member-entity entity-alias="CR" entity-
>> name="CustRequestAndRole"/>
>>       <member-entity entity-alias="Per" entity-name="Person" />
>>
>>      <alias entity-alias="CR" name="custRequestId"  />
>>      <alias entity-alias="CR" name="custRequestTypeId" />
>>      <alias entity-alias="CR" name="statusId" />
>>      <alias entity-alias="CR" name="fromPartyId"/>
>>
>>      <alias entity-alias="CR" name="priority" />
>>      <alias entity-alias="CR" name="custRequestDate" />
>>      <alias entity-alias="CR" name="responseRequiredDate" />
>>      <alias entity-alias="CR" name="custRequestName" />
>>      <alias entity-alias="CR" name="description" />
>>      <alias entity-alias="CR" name="createdDate" />
>>      <alias entity-alias="CR" name="lastModifiedDate" />
>>      <alias entity-alias="CR" name="lastModifiedByUserLogin" />
>>      <alias entity-alias="CR" name="partyId" />
>>      <alias entity-alias="CR" name="roleTypeId" />
>>      <alias entity-alias="Per" name="firstName" />
>>      <alias entity-alias="Per" name="lastName" />
>>
>>      <view-link entity-alias="CR" rel-entity-alias="Per">
>>        <key-map field-name="partyId"/>
>>      </view-link>
>>
>>
>>    </view-entity>
>>
>>
>> However I cannot get number 1 working...
>>
>> I have tried to use the view I have created... and link to that...  
>> e.g.
>> below...
>>
>>      <view-entity entity-name="CaseSummaryAndRoleAndContactView"
>>            package-name="com.catalystic.iodine.crm"
>>            title="Case Summary View Entity">
>>      <member-entity entity-alias="CR"
>> entity-name="CaseSummaryAndRoleView"/>
>>       <member-entity entity-alias="FPer" entity-name="Person" />
>>      <alias entity-alias="CR" name="custRequestId" prim-key="true" />
>>      <alias entity-alias="CR" name="custRequestTypeId" />
>>      <alias entity-alias="CR" name="statusId" />
>>      <alias entity-alias="CR" name="fromPartyId" prim-key="true"/>
>>
>>      <alias entity-alias="CR" name="priority" />
>>      <alias entity-alias="CR" name="custRequestDate" />
>>      <alias entity-alias="CR" name="responseRequiredDate" />
>>      <alias entity-alias="CR" name="custRequestName" />
>>      <alias entity-alias="CR" name="description" />
>>      <alias entity-alias="CR" name="createdDate" />
>>      <alias entity-alias="CR" name="lastModifiedDate" />
>>      <alias entity-alias="CR" name="lastModifiedByUserLogin" />
>>      <alias entity-alias="CR" name="roleTypeId" prim-key="true" />
>>      <alias entity-alias="CR" name="firstName" />
>>      <alias entity-alias="CR" name="lastName" />
>>        <alias entity-alias="FPer" name="firstName" />
>>      <alias entity-alias="FPer" name="lastName" />
>>
>>       <view-link entity-alias="CR" rel-entity-alias="FPer">
>>        <key-map field-name="fromPartyId" rel-field-name="partyId" />
>>      </view-link>
>>
>>    </view-entity>
>>
>> But it always seems to link to partyId and not fromPartyId.
>>
>> How can I see the SQL statements being generated from my view  
>> definitions?
>>
>> Is it possible to do what I want to do?
>>
>> Thanks in advance
>>
>> Regards
>>
>> MArk
>>