cancel
Showing results for 
Search instead for 
Did you mean: 

Assciation With An External Service Entity Not Working

AakashN24
Participant
0 Kudos
158

Hi All,

I Have an two different CAP Applicaitons A and B

the entity in application A

 

 

entity EntityA {
  key ID : String;
  ...
}

 

 

the entity in applicaiton B

 

 

entity EntityB {
  key ID : String;
  requestNo: String; //foreign key
}

 

 

in the applicaiton A

i am importing the serice of the EntityB and i'm trying to associate with EntityA at service level,

 

 

using {com.db as my} from '../db/schema';
using {MyExt} from './external/MyExt'

entity EntityA as
        projection on my.EntityA {
            *,
            to_EntityB: Association to many EntityB on to_EntityB.requestNo = ID
}

entity EntityB as projection on myExt.EntityB;

 

 

here the association works fine and is even shown the properly in metadata,

but when i am trying to query int he browser using the

 /EntityA?$expand=to_EntityB

it dosen't show any association field to_EntityB in the serivce, like we normally get from odata service

please help me in resolving this issue,

Regards,

Aakash

 

View Entire Topic
Willem_Pardaens
Product and Topic Expert
Product and Topic Expert

Have a look at the documentation here: https://cap.cloud.sap/docs/guides/using-services#integrate-and-extend.

You'll need to connect to App A to send the query, get the results, and then mash it up with the local data.

AakashN24
Participant
0 Kudos
Thank You Willem, able to achive this, using a custom handler as you have suggested above