The CreatorCon Call for Content is officially open! Get started here.

Display Quarter number based on date in Year

chanikya
Kilo Sage

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

1 ACCEPTED SOLUTION

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;




find_real_file.png


View solution in original post

37 REPLIES 37

find_real_file.png





find_real_file.png




(function executeRule(current, previous /*null when async*/) {



var gdt = new GlideDateTime(current.u_current_date);


var month = gdt.getMonth();


current.u_qua = Math.ceil(month/3);


//current.update();




})(current, previous);


why after business rule.?. change it to before.



after business rule: we use when we need to do some operation in another table. and i think you are updating the value in same table that you have selected in your business rule


Hi Harsh Vardhan



same issue here,



find_real_file.png



find_real_file.png


find_real_file.png


are you doing it on demo instance. if yes then i can have look into this..


Hi,



i m doing it   in my personal instance