Business rule to set field with Month/Year from date field

swnewton
Kilo Guru

I want to use a business rule to get the Month and Date from a Date field, and then populate a string field with those values.   Both fields are on the same table (time_card).

Thanks for the help!

25 REPLIES 25

Hi Van,



I don't see the option on this thread, but I do see it on the "Resource Plan to include skills" thread.



I think I had the option before, but I don't remember for sure.


Skip -- would you mind pasting the code you used to get this working?   Thanks!


Abhinay Erra
Giga Sage

You can use this


var gDate = new GlideDate();


gDate.setValue(current.<date field name>);


var gDT = new GlideDateTime(gDate);


var year=gDT.getYear();


var day=gDT.getDayOfMonth();


var month=gDT.getMonth();



Not able to get this to work - can someone post the full script please?


Thanks!


kim.sullivan@postproperties.com



  I need more details. What is your use case? Are you doing this from a business rule? If you have code, please post here I can look in to it.