Skip to Content
0
Mar 14, 2021 at 07:01 AM

Vew is not working in CAP (Joining condition on Generated IDs )

49 Views

Hi Folks,

I have two tables Header and Items, both table are as below:-

entity Header: cuid, managed,lockTransaction{
                 prop1: String(10); 
                 prop2: String(10); 
                 prop3: String(40); 
                 items      : Composition of many Items on $self = items.parent;

entity Items: cuid{
              parent  : Association to Header;
              ItemsProp1: String(4);                 
              ItemsProp2: String(40);             
              ItemsProp3: String(100);    
              ItemsProp4: String(40);              

 define view XXReport as
            select from Header as h 
            left outer join Items as i 
            on h.ID = i.parent_ID           
         {
        key h.prop1,
            h.prop2,
            h.prop3,
            i.ItemsProp1,
            i.ItemsProp2,
            i.ItemsProp3,
         }
         order by prop1; 

Throwing error that, i.parent_ID property not found. 

but same is working on CQL.

let items = await tx.run(
			SELECT.from(Items).where({
				parent_ID: req.data.ID,
			})
		);

But this is working.