how i get CurrentFinancialYear

0
i want to get current financial year in a microflow dynamically Ex.FinancialYear = '2021-2022’ it should be be dynamic not static. how will i get that. X path Consttrins like : [FinancialYear = '$CurrentFinancialYear’]
asked
2 answers
4

Hi Rahul,

use this below code

if parseInteger(formatDateTime([%CurrentDateTime%], 'M')) >= 4 

then 

(formatDateTime([%BeginOfCurrentMonth%], 'YYYY') +' - '+ formatDateTime(addYears([%BeginOfCurrentMonth%],1), 'YYYY'))

else

(formatDateTime(addYears([%BeginOfCurrentMonth%],-1), 'YYYY') +' - '+ formatDateTime([%BeginOfCurrentMonth%], 'YYYY'))
 

answered
2

if parseInteger(formatDateTime([%CurrentDateTime%], 'M')) >= 4

then

(formatDateTime([%CurrentDateTime%], 'YYYY') +' - '+ formatDateTime(addYears([%CurrentDateTime%],1), 'YYYY'))

else

(formatDateTime(addYears([%CurrentDateTime%],-1), 'YYYY') +' - '+ formatDateTime([%CurrentDateTime%], 'YYYY'))

We can also use this code while using the begin of current month will cause some variation in UTC and the session which some time leads to issue while running on the cloud. Example: For the month of jan there occurs variation in the session and the UTC so it consider the pervious year Dec month.

answered