Illegal access to getter method getLocalDateTime in class com.glide.glideobject.GlideDateTime
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2022 11:42 PM
Hi All,
I had worked on a requirement to automate the Time Sheets based on Users time off calendar event, with start and end date. In that duration the time sheets have to be automated.
I have written a Business rule which runs on insert of user calendar event with type time off. which is working fine.
One more Business rule, which runs on change of Start and End date according to that time sheets with the change dates will be recalled.
So It is working fine in dev instance and throwing error in test instance - error is "" Can anyone help me why I'm getting this error? Please help me to fix this.
Thanks in advance...
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2022 12:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2022 12:23 AM
Hi Ankur,
I didn't use that function, the start and end dates in user_calendar_event table is of scheduledGlideDateTime so to convert that to Glidedate i used the following function, which is working fine in Business rule used for Time Sheet Insert, on user_calendar_event insert with type- time off... how could this does'nt work in Business rule written to work on date change, that too in a specific instance ? Could you please help me if i miss anything here?
In Business rule -
var endDate1 = automation.convertScheduledGlideDateTimeToGlideDate(current.getValue('user'), previous.end_date_time);
var endDate2 = automation.convertScheduledGlideDateTimeToGlideDate(current.getValue('user'), current.end_date_time);
In Script include -
convertScheduledGlideDateTimeToGlideDate: function(user, date) {
var api = new SNC.ResourceManagementAPI();
var timeZone = api.getUserTimeZone(user);
var dateTimeInUserTimeZone = new GlideScheduleDateTime(date.getGlideObject());
dateTimeInUserTimeZone.setTimeZone(timeZone);
var iDate = dateTimeInUserTimeZone.getIntegerDate();
var convertDate = RMUtil.glideDateFromIntegerDate(iDate);
return convertDate;
},
i referred this conversion from Business Rule - Create allocation daily entries..