ACL - current ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2016 03:34 AM
I'm writing ACLs for TimeCards and here is the issue I faced: within ACL Script I want to log:
gs.log('**** TimeCard.Sunday.acl.week_starts_on = '+current.week_starts_on);
However value of current.week_starts_on is always different and unpredictable. Sometimes I can get date that is one or two weeks ahead.
Only last hour it got to normal work returning the real value of week_starts_on.
**** TimeCard.Sunday.acl.week_starts_on = 2016-10-16
Any ideas of possible root-cause?
P.S. Additionaly I was calling Script Include from ACL Script field and passing current object to Script Include.
Script Include also logged unpredictable values.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2016 03:54 AM
This is present in the dictionary default value for the field
javascript:var today = new GlideDateTime(); var dtUtil = new DateTimeUtils(); var firstDay = gs.getProperty("com.snc.time_card.start_day", 7); var start = dtUtil.getWeekStart(today, firstDay); start.getDisplayValue();
So if the field is empty, that would be the reason why.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2016 03:59 AM
No, field is not empty. I am sure. This is not about field emptiness - this is about some other conflig of logic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2016 04:17 AM
Just look what values it gets from the same Time Card:
Notice that Saturday = 2016.11.05 and Friday in the same TimeCard somewhy equals 2016.10.30 (Week Starts On = 2016-10-16)
So far I have 7 ACLs for each day. Code example follows:
var moDay = current.week_starts_on.getGlideObject();
moDay.addDays(1); // Depends on ACL for each day integer is different (Su=0,Mo=1,Tu=2,We=3,Th=4,Fr=5,Sa=6)
gs.log('TimeCard.Monday = '+moDay);
...
Am I doing something wrong that SN calculates this way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2016 04:38 AM