How to Create Dialog Box and Display Data from Fusion REST API in VBCS

How to Create Dialog Box and Display Data from Fusion REST API in VBCS

How to Create Dialog Box and Display Data from Fusion REST API in VBCS

In VBCS, a dialog box is usually used to display additional information, forms or confirmations messages without navigating away from the current page.

In this post, we will see how to configure dialog box in VBCS.

Requirement:

We have VBCS Page with one input Text field and one button.

We can provide Supplier Number in Input Text field and click on Search.

This will open Dialog box to display details of supplier.

Let us follow steps to achieve this.

Step1: Create VBCS Web App for Search Page.

Navigate to Web Apps—>Create Web Application.

Provide valid Application Name as shown and click on Create.

A screenshot of a computer

AI-generated content may be incorrect.

Rename the page heading.

A screenshot of a computer

AI-generated content may be incorrect.

Add form Layout region to create search input Text field for Supplier.

A screenshot of a computer

AI-generated content may be incorrect.

Set the properties of Form Layout Region.

A screenshot of a computer

AI-generated content may be incorrect.

This property will set Label of inside text field at start.

Now let us drop Input Text field for providing Supplier Number.

A screenshot of a computer

AI-generated content may be incorrect.

Change the label to “Supplier Number”

A screenshot of a computer

AI-generated content may be incorrect.

Drag and drop Button to call Dialog box.

Set Label property and chroming property to “Call To Action”.

Run the application.

A screenshot of a computer

AI-generated content may be incorrect.

Step2: Create Service Connection to Call Supplier REST API.

Navigate to Service Connection —->Create New Service Connection.

A screenshot of a computer

AI-generated content may be incorrect.

Select “Select from Catalog” option.

A screenshot of a computer

AI-generated content may be incorrect.

Select “Enterprise Resource Planning and Supply Chain”

A screenshot of a computer

AI-generated content may be incorrect.

This will start loading all the REST endpoints from Fusion.

A screenshot of a computer

AI-generated content may be incorrect.

Provide valid Service connection Name and select Supplier Rest Endpoint as shown below.

A screenshot of a computer

AI-generated content may be incorrect.

Click on Create.

A screenshot of a computer

AI-generated content may be incorrect.

Service connection is created successfully.

Step3: Create Dialog Box to display supplier details.

Navigate to page designer.

A screenshot of a computer

AI-generated content may be incorrect.

Drag and drop Dialog box region to page designer grid region.

A screenshot of a computer

AI-generated content may be incorrect.

Set property of this dialog box.

A screenshot of a computer

AI-generated content may be incorrect.

Property

Value

ID

SupplierDetailsDialog

Dialog Title

Supplier Details

Drag Affordance

Title-bar

Initial Visibility

Hide

Temporary Override

Off

Modality

Modal

Draggable

True

Hidden

False

Spellcheck

False

Title

Supplier Details

Cancel Behaviour

Icon

Width

100vh

Height

100vh

Min-Width

100vh

Min-Height

100vh

Max- Width

100vh

Max-Height

100vh

Now, create action chain on button to call this Dialog Box.

A screenshot of a computer

AI-generated content may be incorrect.

This will create new action chain.

A screenshot of a computer

AI-generated content may be incorrect.

To call Dialog box in action chain, we need to drag and drop “Call Component” action and select earlier created dialog in selector.

Also set Method as “Open”.

A screenshot of a computer

AI-generated content may be incorrect.

Now run the application.

Once clicked on Search button, it will open Supplier Details Dialog box.

A screenshot of a computer

AI-generated content may be incorrect.

Step4: Design Dialog Box.

Now let us design this dialog box to show Supplier data from Supplier REST.

Create variable to store Supplier Number from Parent main page.

A screenshot of a computer

AI-generated content may be incorrect.

Click on variable.

A screenshot of a computer

AI-generated content may be incorrect.

Assign this variable to Supplier Number field.

A screenshot of a computer

AI-generated content may be incorrect.

Add Read only Text Field on Dialog Box to display this supplier Number.

Also add Table to display the Supplier REST Result.

A screenshot of a computer

AI-generated content may be incorrect.

Now navigate to Data and assign same variable created earlier.

A screenshot of a computer

AI-generated content may be incorrect.

Drag and Drop Table on Dialog box.

A screenshot of a computer

AI-generated content may be incorrect.

Let us create Type and ADP variable and assign to this table.

Navigate to Type—>Create from Endpoint.

A screenshot of a computer

AI-generated content may be incorrect.

A screenshot of a computer

AI-generated content may be incorrect.

Click on Next.

A screenshot of a computer

AI-generated content may be incorrect.

Provide valid Name and select required fields and click on Finish.

Navigate to Variable and Click new Variable with type as “Array Data Provider”.

A screenshot of a computer

AI-generated content may be incorrect.

Select Key Attributes as shown below:

A screenshot of a computer

AI-generated content may be incorrect.

Assign this ADP variable to Table.

A screenshot of a computer

AI-generated content may be incorrect.

We will call REST API and populate this ADP variable in action chain.

Navigate to action chain and drag and drop “Call REST” component.

A screenshot of a computer

AI-generated content may be incorrect.

Set query parameter.

A screenshot of a computer

AI-generated content may be incorrect.

Click on Save.

Now assign result to ADP variable.

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.

Click on Search.

A screenshot of a computer

AI-generated content may be incorrect.

Dialog box is populated with respective supplier details.

Step5: Add Progress Bar for Dialog Box.

We can add progress bar prior to dialog Box so that we can show loading while getting REST API response.

Follow below steps to implement progress bar:

Create another Dialog Box to add progress bar.

A screenshot of a computer program

AI-generated content may be incorrect.

Set below properties for this dialog box:


Property


Value

Dialog Title

Loading…

Title

Loading…

Initial Visibility

Hide

Temporary Override

Show

ID

ProgressBarDialog

Hidden

False

Drag and drop progress bar on Grid row of dialog box.

A screen shot of a computer

AI-generated content may be incorrect.

Set progress bar properties as below:

A screenshot of a computer

AI-generated content may be incorrect.

A screenshot of a computer

AI-generated content may be incorrect.

Value must be -1.

We will call this dialog box before calling Supplier Details Dialog box in action chain.

Navigate to action chain.

A screenshot of a computer

AI-generated content may be incorrect.

Now close this dialog box once we get reply from REST API.

Run the Application.

A screenshot of a computer

AI-generated content may be incorrect.

Click on Search.

A screenshot of a computer

AI-generated content may be incorrect.

A screenshot of a computer

AI-generated content may be incorrect.

In this way, we can use Dialog box and progress bar to provide better user experience for VBCS applications.

Leave a Reply

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

Back To Top