Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sunil5
Explorer
689

Handle the behavior of extension field by toggle button using SDK UI designer.

Suppose there is one such requirement: We should have one toggle button and using that toggle button we can control the field behaviors like “Mandatory”, “Read Only” or “Visible” so, fields will behave the same as mentioned above when toggle button is set to true. To implement this requirement, we have created 3 different extension fields as “Extension field M”, “Extension field V”, “Extension field R” and one indicator field as “Manage Field” (indicator field act as a toggle button in front-end) in Service Request (Ticket) standard BO. We can make the “Extension field M” field as mandatory, the “Extension field V” field as visible, and the “Extension field R” field as read-only by toggle button (“Manage Field”) using UI designer in SDK.

Procedure: -

Here We have added extension fields in Service Request Extension BO (Ticket).

To add extension field to Extension BO we need to follow below steps:

  1. Open your solution and click on Add New Item and select the “Extension” and from the list select “Business Object Extension” then click on Add. Select required namespace and BO name then click ok.

Sunil5_1-1713769816813.png

 

Sunil5_2-1713769857108.png

     2. After creation of “Business Object Extension” then add extension fields in this BO as shown below.

Sunil5_3-1713769964246.png

We now have extension fields created in Service Request Extension BO in Cloud Application Studio. Based on our requirement add these extension fields in the UI screen of Extension BO in Cloud Application Studio. Here We have added these extension fields in the TI screen of Service Request Extension BO. Now you can see these Extension fields in below SS.

To add extension field in UI screen of Extension BO we need to follow below steps:

  1. Right click on BO and select “Enhance Screen” then select the screen as your requirement.
  2. In screen, select group section and select “Add Extension field to Section Group” under the “Extensibility explorer” then select field which need to add in the screen then save and activate the UI screen.

Sunil5_4-1713770008184.png

Extension fields have been added successfully in UI screen as below.

Sunil5_5-1713770045689.png

As per our requirement, now we will make the "Extension field M" field as mandatory field, the "Extension field R" field as read-only field and the "Extension field V" field as visible field in the UI screen using toggle button ("Manage Field") in cloud application studio. Here you need to follow the below steps:

  1. Open the UI screen in cloud application studio where we have added to the extension fields. Here we have opened the TI screen of Service Request Extension BO. Select the field group where we have added the extension fields and click on “Adjust Properties” under the “Extensibility Explorer” as shown below.

Sunil5_6-1713770101138.png

     2. Now we need to bind "Extension field M" field to the indicator field (toggle button) for mandatory, bind "Extension field R" field to the indicator field for ReadOnly and "Extension field V" field to the indicator field for Visible. Then, click on “Apply” as shown below, save and activate to the UI screen to finish this setup.

Note- if we do not bind these fields with indicator field and select the “True” value there, then by default these fields will have same behavior every time.

For an example: if for "Extension field M" field, property “Mandatory” is set to “True” then this field will become mandatory by default.

Sunil5_7-1713770151109.png

Result: -

After Completion of all the setup in SDK, now we can preview our changes when we will turn on the toggle button (“Manage Field”), then all the fields will behave as we expected.

Sunil5_8-1713770182573.png

when we will turn off the toggle button (“Manage Field”), then all the fields will behave as we expected.

Sunil5_9-1713770213324.png

Conclusion: -

Now you can change the behavior of these fields based on toggle button (Manage field).

 

Labels in this area