joshualawrence
Occasional Member - Level 1

Audit rule - City Mandatory

How do i write an audit to make city field on the entry mandatory for a particular country. I cannot let the user leave it blank. 

Audit rule does not have a "Is blank" option to validate.

joshualawrence_0-1777476905063.png

 

I understand we can make it mandatory on the form, but i do not want to do that because all our EMEA countries are grouped into 1 EMEA Group and the all the forms are assigned to this group. if i make it mandatory on the form, it will make it mandatory for all countries.

7 REPLIES 7
cjmarimo
Super User
Super User

Hello @joshualawrence ,

 

You can try using Validations.

Validations do allow you to check whether a field is empty and to apply more complex logic using expressions, although they are more technical to maintain.

cjmarimo_0-1777477764905.png

 

 

I’m attaching a link below: Forms and Fields: Validation

 

 

BR,

cj

joshualawrence
Occasional Member - Level 1

Thank you @cjmarimo . This is very interesting, but how do you write the expression to fire only when org unit 1 = 454?

@joshualawrence 

I'm sorry, I'm not an expert with regular expressions.

I think you could do something like this:

                              CountryCode == "US" && OrgUnit1 == "454" && City matches "^\\s*$"

joshualawrence
Occasional Member - Level 1

@cjmarimo 

validation drop down is greyed out. I can change the Field label and access rights

joshualawrence_0-1777480717824.png

 

@joshualawrence Are all the employees this would apply to assigned to Org Unit 454? If so, you wouldn't need a validation, but could use a regular audit rule. 

 

Or are you saying that no matter who the employee is, if they enter Org Unit 454 for that entry the rule will fire. 

 

I think you might be able to use a regular audit rule, but I need to hear back from you. 


Thank you,
Kevin
SAP Concur Community Manager
Did this response answer your question? Be sure to select “Accept as Solution” so your fellow community members can be helped by it as well.
joshualawrence
Occasional Member - Level 1

@KevinD orgunit1 value is on the employee profile that gets copied to the expense report. It is not editable by the employee. its their company code. Not all employees are assigned to 454. Only Israel employees are assigned to 454. I want this validation to fire only Israel employees, and they we identify is by using org unit1 = 454

 

How can i accomplish in a regular audit rule ?

@joshualawrence sorry, I got ahead of myself. I asked a colleague about this and he said the validations option suggested by @cjmarimo wouldn't work as you can only write validations for Text fields. The City field is an integer field. 

 

My initial thought wouldn't work since, as you mentioned, there is no option for City is Blank. 

 

You would either need to create a custom City field or create a new Employee and Expense group for the Israel employees. 


Thank you,
Kevin
SAP Concur Community Manager
Did this response answer your question? Be sure to select “Accept as Solution” so your fellow community members can be helped by it as well.