AnsweredAssumed Answered

First Day of next month

Question asked by rjdas on Aug 15, 2018
Latest reply on Aug 15, 2018 by britto.parthalomew

I need to run a process on the last day of each month, in the mapping I need to pass the effective date to Salesforce as first day of next month. i.e If I am running my process on 31st Aug, 2018, in effective date mapping I need to pass Sept 1st, 2018

 

I wrote below java script code:


var tranDate = new Date()
tranDate.setMonth(tranDate.getMonth()+1, 1)

 

I get below error when I execute my process:

 

[Output ProfileLocation: DatedConversionRate/StartDate; DocumentLocation: /DatedConversionRate[0]/StartDate[0]]: Error Formatting Date '[Date 2018-09-01T19:08:00.222Z]', Expected Format yyyyMMdd HHmmss.SSS: Failed parsing '[Date 2018-09-01T19:08:00.222Z]' due to extra trailing character(s) '[Date 2018-09-01T19:08:00.222Z]'

Outcomes