Skip to Content

$expand to get "ToContacts" Fields

Hello Experts,

I am using GWSAMPLE_BASIC service from es4 system.

I have created a split app where master page shows the businesspartnerid. On select of any id, i have to show fields from Contacts.

in Odata Businesspartnerset is connected with contacts with "ToContacts".

In List i can show it using expand parameter but how can i show all Contacts fields to simpleform ?

I simply use like below:

<Label text="Language"/>

<Text text="{ToContacts/Language}"/>

<Label text="Date of Birth"/>

<Text text="{ToContacts/DateOfBirth}"/>

But its not working.

thanks in advance.

Abhi

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Aug 15, 2016 at 04:22 PM

    You can find some examples at

    https://scn.sap.com/thread/3559486

    Regards,

    Jamie

    SAP - Technology RIG

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello Jamie,

      Now i am doing in a same view where created a table which shows data from businesspartnerset and also from contacts(first name/last name)

      Table is defined as below:

      <Table id="table" width="auto"

      items="{ path: '/BusinessPartnerSet',

      sorter: { path: 'BusinessPartnerID', descending: false },

      parameters : { expand : 'ToContacts' } }">

      and then column

      <ObjectIdentifier title="{BusinessPartnerID}"

      text="{

      parts:[ {path:'ToContacts/FirstName'}, {path:'ToContacts/LastName'} ],

      formatter:'.formatter.getName' }"/>

      but its not working.

      Is it because the BusinessPartenerSet is mapped with Contactset with 1:N . So ToContact will return an array so binding like oContacts/FirstName is not possible.

      thanks,

      Abhi

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.