Skip to main content
Solved

How to make a field mandatory with condition


ashenfdo
Sidekick (Customer)
Forum|alt.badge.img+8

Is anyone aware how to set up expressions for making a field mandatory?

I want to make this field mandaatory only if the customer’s Country is ITALY

I went through this documentation but it doesn't explain the expression clearly

https://docs.ifs.com/techdocs/24r1/040_tailoring/225_configuration/200_client_configurations/310_conditional_fields/

 

 

Best answer by Abdul

Hi ​@ashenfdo,

Working fine in my testing. Please refer to the screenshots below.

For any other Country, the system allows saving the record without entering the value for Region Italy field.

 

What is your Cloud verison? Why you are using ITALY instead IT in your syntax?

 

View original
Did this topic help you find an answer to your question?

10 replies

Abdul
Superhero (Partner)
Forum|alt.badge.img+17
  • Superhero (Partner)
  • 404 replies
  • June 7, 2025

Hi ​@ashenfdo,

Please refer to the discussion below.

https://community.ifs.com/localizations-433/using-condition-input-to-make-a-field-not-editable-58690

Likewise, you can enter same kind of a syntax to make a field mandatory.

Please let me know if you need further assistance.

 

Regards 

Abdul Rehman 


Forum|alt.badge.img+10
  • Hero (Employee)
  • 118 replies
  • June 9, 2025

Hi, 

‘I went through this documentation but it doesn't explain the expression clearly’ - It would help to know what aspect of the documentation you think needs to be more clear. 

What attribute holds the customer region information and what is the relation to the entity that you have attached CF_Region_Italy to?

 

Kind regards

Tobias 


ashenfdo
Sidekick (Customer)
Forum|alt.badge.img+8
  • Author
  • Sidekick (Customer)
  • 62 replies
  • June 10, 2025

Hi ​@Abdul  I have set it as below but still its not mandory for customers with country ITALY

 

 


ashenfdo
Sidekick (Customer)
Forum|alt.badge.img+8
  • Author
  • Sidekick (Customer)
  • 62 replies
  • June 10, 2025

Hi ​@tofuse  CF_Region_Italy is attached to entity CustomerInfo

 


Abdul
Superhero (Partner)
Forum|alt.badge.img+17
  • Superhero (Partner)
  • 404 replies
  • June 10, 2025
ashenfdo wrote:

Hi ​@Abdul  I have set it as below but still its not mandory for customers with country ITALY

 

 

Hi ​@ashenfdo,

Please enter Country = "IT" only.

If your Cloud version is 24R1 or earlier then check with record.Country = "IT".

 

 


ashenfdo
Sidekick (Customer)
Forum|alt.badge.img+8
  • Author
  • Sidekick (Customer)
  • 62 replies
  • June 10, 2025

Hi ​@Abdul 

 

I have tried Record, Parent.Record

 

Now its mandatory for all not only for country ITALY

 

 


Abdul
Superhero (Partner)
Forum|alt.badge.img+17
  • Superhero (Partner)
  • 404 replies
  • Answer
  • June 10, 2025

Hi ​@ashenfdo,

Working fine in my testing. Please refer to the screenshots below.

For any other Country, the system allows saving the record without entering the value for Region Italy field.

 

What is your Cloud verison? Why you are using ITALY instead IT in your syntax?

 


ashenfdo
Sidekick (Customer)
Forum|alt.badge.img+8
  • Author
  • Sidekick (Customer)
  • 62 replies
  • June 10, 2025

@Abdul  which version is this? I am testing on 24r2


ashenfdo
Sidekick (Customer)
Forum|alt.badge.img+8
  • Author
  • Sidekick (Customer)
  • 62 replies
  • June 10, 2025

Hi ​@Abdul  thanks a lot 

 

its works

 

 


Forum|alt.badge.img+10
  • Hero (Employee)
  • 118 replies
  • June 11, 2025

Hi, 

"What attribute holds the customer region information, and what is the relation to the entity that you attached CF_Region_Italy to?"

It wasn't clear what I was asking for. You didn’t initially show how you constructed the condition, so I was asking which attribute holds the region you referred to, which I now know is ‘Country’. I asked this because I wanted to understand whether you were referencing something specific.

The issue you ran into here is that you expected the value displayed in the field to be the actual value stored on the record. When you write a condition, it will validate against the record value, not the formatted display value. It can sometimes be unclear what’s what, so you need to figure that out.

In this case, you can see that the field you’re writing the condition against is a dropdown, which means it’s either an enumeration or a reference. In either case, the actual value stored on the record will be an enum ID or a reference key, not the display value. You can use the browser’s debug console to look for the actual value. For example, in Chrome’s debug console under the Network tab, if I click refresh on my current record, I see that ‘CustomerInfoSet’ is refreshed, and the response looks like the example below. Here, you can see that the enum ID for ‘ITALY’ is actually ‘IT’, which is what you need to use in your condition:

 

 

This gives the condition

`Country = “IT”`


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings