- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2017 10:22 PM
1.Quarter number
2.Current number
Display Quarter number based on date
Ex: Jan to march Between related dates Display Quarter -1
April to June Between related dates Display Quarter -3 etc.
Ex:
now Current date: 2017-01-20 week: Quarter-1;
now Current date:2017-05-14 week: Quarter-2
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2017 12:22 AM
remove current.update()
var check= current.u_another_open;
var test = new GlideDateTime(check);
var mn = test.getMonth();
var quar = Math.ceil(mn/3);
gs.log('hellosssssss'+quar);
current.u_dateee=quar;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2017 12:08 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2017 12:14 AM
i checked at my PDI it's giving me the correct quarter.
can you put the log in your business rule and by the way don't use update() in your business rule. without update() it will set the value in target field.
share your complete business rule..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2017 12:19 AM
Hi Harsh Vardhan,
Script is :
var gdt = new GlideDateTime(current.u_current_date);
var month = gdt.getMonth();
current.u_qua = Math.ceil(month/3);
current.update();
please check is there any thing wrong

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2017 12:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2017 12:24 AM
Hmm.. For some reason, I could see the issue in my instance as well. I replaced getMonth() with getMonthLocalTime(), which helped me solve the issue. Can you try this?