Which IIQ version are you inquiring about?
Version 8.X
Share all details related to your problem, including any error messages you may have received.
Hi Team,
How to set the current date to the calendar input value in form. I am developing one report where requirement to set the system date to the calendar field.
Regards,
Ravi.
I am using the version 8.2 version.
try something like below
<Parameter argument="creationDate" property="created">
<QueryScript>
<Source>
import sailpoint.object.Filter;
import sailpoint.tools.Util;
import java.util.Date;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.text.DateFormat;
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DATE);
calendar.set(year, month, day, 0, 0, 0);
filter_GE = Filter.ge("created",calendar.getTime());
calendar.set(year, month, day, 23, 59, 59);
filter_LE = Filter.le("created",calendar.getTime());
finalfilter = Filter.and(filter_GE,filter_LE);
queryOptions.addFilter(finalfilter);
return queryOptions;
</Source>
</QueryScript>
</Parameter>
1 Like
iamksatish
(Satish Kurasala)
May 31, 2024, 2:38am
4
@kolipakularaviturnkey
Is this date editable by end user, or you want to set it to the current date and make it read only
Anyhow you can add the field in the form as type=date as in below, this will create a datepicker field
If you want to make readOnly, just add readOnly=“true”, if not default value will be current date and user can select a different one if required.
<Field displayName="Current Date" helpKey="Current Date" name="dateAttr" type="date" value="ref:dateAttr" >
<Script>
<Source>
import java.util.Date;
Date currDate=new Date();
return currDate;
</Source>
</Script>
</Field>
Hope this same field you will reference and use in report parameter for queryOptions as per your need and in the arguments.
@kolipakularaviturnkey what you will use with current date ? just curious to understand the requirement here.
1 Like
Thanks Satish it worked for me
system
(system)
Closed
July 30, 2024, 3:48am
7
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.