Hi there,
I'm new to scripting so I'll ask for your help often :)
I have two fields named "Hedeflenen Tamamlanma Tarihi" and "DA Onay Tarihi".
The user needs to fill in the "Hedeflenen Tamamlanma Tarihi" field first and then the "DA Onay Tarihi" field.
My request is:
When the user selects "DA Onay Tarihi" before the "Hedeflenen Tamamlanma Tarihi", the "DA Onay Tarihi Hedeflenen Tamamlanma Tarihinden önce olmalıdır." I want a warning.
Example;
If the Hedeflenen Tamamlanma Tarihi: 01.01.2022 is selected and the user chooses the DA Onay Tarihi as 03.01.2022, I want it to give an error.
Could you please help me?
Have a nice day :)
If you want to do this in a Workflow Validator (as implied by your tags), you can easily do this with a simple scripted validator.
def date1 = cfValues['DA Onay Tarihi']
def date2 = cfValues['Hedeflenen Tamamlanma Tarihi']
date2 >= date1
When the simple scripted validator returns true, then nothing happens. When it returns false, it will display the warning of your choosing. The warning and the placement of the warning can be entered in the simple scripted validator configuration screen.
I placed the same script you wrote in the stream as a simple script validator. What is the reason for the errors that appear?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hover over the underlined text and it will tell you. Perhaps the field name is incorrectly spelled for the first field.
Then the comparison can't be confirmed to be correct since the code checker doesn't know what value will be returned from a field that it doesn't recognize.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's giving an error because there are 2 fields with the same name.
Now it gives an error when I choose the right date. Could it be that the 'DA Approval Date' field type is a date time picker, and the 'Target Completion Date' field type is a date picker?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peter, I edited the fields and ran your code again and it worked.
Thank you very much for your help :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.