<= condition for today in BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 01:00 AM
How to write a <= today condition in a BR.
So, last bia approval is a date field. In this BR, i need to check that if last bia approval is not empty and last bia approval is <= today or > today.
Is this the correct way to write this for a date field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 03:40 AM
Hi,
You could have a no code solution for this if you split this out in 2/3 BR
Use condition builder and set value .
I would recommend that instead of using < in script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 09:37 PM
Pls check the following script-
if (current.u_last_bia_approval != '') {
var lastBiaApproval = new GlideDateTime(current.u_last_bia_approval);
var today = new GlideDateTime();
today.setDisplayValue(today.getDate().toString());
if (lastBiaApproval <= today) {
current.setValue('u_bia_state', 'Expired BIA');
} else {
current.setValue('u_bia_state', 'Valid BIA');
}
}
Regards,
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2024 12:18 AM
Here i have 3 conditions:
1. When last bia approval is empty then set bia state as not published.
2. When last bia approval is not empty and last bia approval <= today then set bia state as expired.
3. When last bia approval is not empty and last bia approval > today then set bia state as published.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2024 12:54 AM
Hi,
I agree with @Anurag Tripathi , there is a no-code/low-code way of doing this, create two or three business rules that sets the field depending on the conditions.
Why do you want to script this? Is there something else going on here?