- 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-07-2017 11:30 PM
Thanks Brian,
I have shared the completed script in the trails below and thats working perfectly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2017 11:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2017 11:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2017 12:26 AM
Hi Chanikya,
If doing via BR:
var gdt = new GlideDateTime();
var month = gdt.getMonth();
var quarter;
gs.print(month);
if((month==1) ||(month==2) ||(month==3) ||(month==4)){
quarter=1;
gs.print("Quarter::"+quarter);
}
else if((month==5) ||(month==6) ||(month==7) ||(month==8)){
quarter=2;
gs.print("Quarter::"+quarter);
}
else{
quarter=3;
gs.print("Quarter::"+quarter);
}
or if you are doin it via client script g_form.setValue("fieldname",quarter);
post me your feedback
Please Hit ✅Correct, â�ï¸�Helpful, or â�£ï¸�Like depending on the impact of the response
Have a lovely day ahead
Regards,
Divya Mishra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2017 12:42 AM
var gdt = new GlideDateTime();
var month = gdt.getMonth();
var quarter;
if((month==1) ||(month==2) ||(month==3) ||(month==4)){
current.u_qua=1;
current.update();
}
else if((month==5) ||(month==6) ||(month==7) ||(month==8)){
current.u_qua=2;
current.update();
}
else{
current.u_qua=3;
current.update();
}
Try this....