Multiple fields for Select (Single) in VBCS

Multiple fields for Select (Single) in VBCS

Multiple fields for Single select in VBCS

In this post, we will see how to display multiple fields in Select (Single) in VBCS application.

When we use Select (Single) component in VBCS, it usually shows only one field in select list. But we can show multiple fields in select list also.

Step1: Create VBCS Web App with Select Single component on page.

Step2: Create Service connection for REST API.

Let us configure oracle fusion REST API for AP Invoices in service connection.

A screenshot of a computer

AI-generated content may be incorrect.

Step3: Create SDP variable to assign to Select (Single) Component.

Create SDP variable and provide endpoint as service connection in step2.

A screenshot of a computer

AI-generated content may be incorrect.

Also provide key attributes such as InvoiceNumber.

A screenshot of a computer

AI-generated content may be incorrect.

Assign this SDP variable to Select (Single) component.

A screenshot of a computer

AI-generated content may be incorrect.

Run the application.

A screenshot of a computer

AI-generated content may be incorrect.

This will show only field (InvoiceNumber) in List of Values.

Now we want to show InvoiceAmount also in List of Values along with InvoiceNumber.

Step4: Add Code to show multiple Fields in Select (Single).

To add multiple fields to Select (Single) LOV, we need to add the below code for Select (Single) components.

Navigate to code.

A screenshot of a computer

AI-generated content may be incorrect.

A screen shot of a computer

AI-generated content may be incorrect.

Code:

  1. <oj-select-single label-hint="Select (Single)" class="oj-flex-item oj-sm-12 oj-md-6"
  2. data="[[$variables.invoicesListSDP]]" item-text="InvoiceNumber">
  3. <template slot="collectionTemplate" data-oj-as="collection">
  4. <oj-table scroll-policy="loadMoreOnScroll" selection-mode.row="single" data="[[collection.data]]"
  5. selected.row="[[collection.selected]]" current-row="{{collection.currentRow}}"
  6. on-oj-row-action="[[collection.handleRowAction]]"
  7. columns='[{"headerText":"InvoiceNumber","field":"InvoiceNumber","template":"cellTemplate","id":"InvoiceNumber"},{"headerText":"InvoiceAmount","template":"cellTemplate","id":"InvoiceAmount","field":"InvoiceAmount"}]'>
  8. </oj-table>
  9. </template>
  10. </oj-select-single>
A screenshot of a computer

AI-generated content may be incorrect.

Run the application.

A screenshot of a computer

AI-generated content may be incorrect.

In this way, we can add multiple fields in Select (Single) List of values

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top