cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a field mandatory in Fiori App?

Vivek_Hegde
Active Contributor
0 Kudos

We have a simple fiori app in solman knows as Create Incident, which basically allows end user to report CRM incident. My question is how to make some input fields as mandatory in the Create Incident app ?

In the app, one of the fields (Title) is a mandatory field by default. I would like to make Configuration Item also as mandatory field. Could you throw some lights here on how to do. Please consider, I am a novice when it comes to Fior/UI5 development, so if you could explain me or give me some hints then I would read and figure out 🙂

Thanks,

Vivek

Andres_Vargas
Participant
0 Kudos

Hi Vivek,

Do you find a good step by step guide to do this?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I faced with the same task.

I used SAP WEB IDE to connect to my system as ABAP repository.

Then I customized application AI_CREATE_INC by editing files in it (view/Details.controller.js , view/Details.view.xml , i18n/i18nproperties. You need some knowledge in Javascript JQuery.

Then deploy it.

malaton
Explorer

hello, can you give detailed description how can we do this.

what should i change in files (view/Details.controller.js , view/Details.view.xml , i18n/i18nproperties)?

Answers (7)

Answers (7)

leonikussmaul
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Vivek,

This should be quite simple to achieve.

In your view, you can locate the property that you'd like to validate as mandatory and set the property required to true. You can then use the change/liveChange event handler of the Input field to set the ValueState to Error if the value is empty.

<Label text="ConfigurationItem" required="true"/> <Input liveChange="onValidate"/>
onValidate: function(oEvent){
var oInput = oEvent.getSource();
if(!oInput.getValue()){
oInput.setValueState("Error");
//optional value state text 
oInput.setValueStateText("This field is required");
}

Please note that you will also need to "reset" the Value State, for this you can define a ternary operator to set it either to Error or to None.

oInput.setValueState(oInput.getValue === "" ? "Error" : "None");
Andres_Vargas
Participant
0 Kudos

Hi Leoni,

Could you please explain with more details that change?


I'm new in UI5 development and, as I know, today I'm not able to use the WEB IDE to make the correction.

former_member242722
Discoverer
0 Kudos

Hello Vivek

Could you please let me know the table name to make the "Category" field as mandatory.

Thank you !!

Uday

Joseph_BERTHE
Active Contributor
0 Kudos

Hello,

Before creating an extension project, please take some time to debug the application. Maybe there is a customization table behind this screen. In HCM fiori app, ther is no documentation, but after some debbuging process we found some customization.

I'm pretty sure it is the same here.

Regards,

Joseph

Joseph_BERTHE
Active Contributor
0 Kudos

Hello,

Before creating an extension project, please take some time to debug the application. Maybe there is a customization table behind this screen. In HCM fiori app, ther is no documentation, but after some debbuging process we found some customization.

I'm pretty sure it is the same here.

Regards,

Joseph

Former Member
0 Kudos

Hi,

Do you managed to solve the problem?

Vivek_Hegde
Active Contributor

No, we have not got any simple solution yet.

Sharathmg
Active Contributor
0 Kudos

you need to extend the application to modify the settings or behaviour of the app. In web use create an extension project for the app and modify it.

Loo up for extension of FIORI app and you will get enough material online .

Regards,

Sharath

Former Member
0 Kudos

Required Labels

To indicate that a field is mandatory, you can set the property “required”. An asterisk will be automatically set in front of the label.

Vivek_Hegde
Active Contributor
0 Kudos

Thanks, can you pls point where to do that? I am a novice in Fiori development, hence some more details on your reply would be helpful for me.

Former Member
0 Kudos

Hi Vivek,

Would you please send us step by step or guide on how to do it.

Thank you,

Dominic