cancel
Showing results for 
Search instead for 
Did you mean: 

How to restrict values of a field based on another field

former_member671720
Participant
0 Kudos

Hi experts,

I am trying to write a rule on this field Identification type

when creating a new individual customer this is the QC screen we get

and now my requirement is like, need to restrict Identification type based on the Nationality dropdown

So, in adaptation, I was trying to add a rule

IF(Root.NationalityCountryCode=="SA", Root.IdentificationTypeCode="ZNID", IF( OR(Root.NationalityCountryCode=="QA", Root.NationalityCountryCode=="BH", Root.NationalityCountryCode=="AE",Root.NationalityCountryCode=="KW"), Root.IdentificationTypeCode="ZGCC", Root.IdentificationTypeCode="IQAMAOR"))

but the field IdentificationTypeCode is not there in the fields list

I want to restrict the values shown in the dropdown, currently, It's showing all values

and code list restrictions IdentificationTypeCode is not available for any BO, that's why I choose to add a rule

is this the right way to do it or can we do it by using SDK
can you pls help

Thankyou
Kishore

PU
Participant
0 Kudos

Hi Kishore,

You can use Debug mode to obtain the field name of the field you mention that you can´t find.

See this blog for details : https://blogs.sap.com/2020/06/15/a-bit-more-to-add-to-c4c-ui-rules/regards,

PU

Accepted Solutions (0)

Answers (1)

Answers (1)

danielvidal_04
Participant

Hi Kishore,

Editor rule that you have tried are just to set fields visible, mandatory or read only, not to restrict value inside itself.

As they are standard dropdown fields, you should use code list restriction. If they are not available there, you could try to set some code in Individual Customer afterModify event and do some checks to avoid user save if wrong combination was chosen, but unfortunately we cannot restrict standard code lists, values would still be visible in the dropdown list.