Conditional mandatory field

Riya17
Giga Contributor

Hi,

I have to make 'justification' mandatory if the 'planned_start_time' is less than 3 hours from the change is requested.  I've tried with business rule, it didn't work.  What is the best way to achieve this.

 

Thanks

Riya

1 ACCEPTED SOLUTION

Same code on form load and Planed Date change

 

Thanks

View solution in original post

22 REPLIES 22

Shweta KHAJAPUR
Tera Guru

Hi,

Try UI policy using below filter condition

start_dateLESSTHANsys_created_on@hour@after@3

 

find_real_file.png

Hi Shweta,

 

I tried the UI policy you've suggested.  The 'Justification' is turning mandatory only for a few seconds and back to optional.  Also it becomes mandatory once I submit the form.  Is there a way 'Justification' becomes mandatory as soon as I enter 'planned_start_date' within 3 hrs from requested.

 

Thak you

Riya

Hi Riya,

I think you might be checking on new record. This will work on the record which is already created. Select a created field from slushbucket (form layout) and then try to compare dates. Because created field will take server time. This will work as per your requirement. 

It'll become mandatory as soon as you select 'planned_start_date'. Just enter planned_start_date and without submitting form just click somewhere on form(cursor should be out of that field). As soon as you click,  the justification will become mandatory.

Hi Shweta,

 

Thank you for your prompt reply.  I need this to work on new Change Requests.

 

Thank you

Riya