How to determine a user.customproperty10 with format "yyyy-MM-dd" as date in CreateAccountJSON?

alc
Regular Contributor
Regular Contributor

Hello

We have use user.customproperty10 as a actiondate in format "yyyy-MM-dd" although its type is String. In CreateAccountJSON, we need set a target account attribute acct_date to be "false" if user.customproperty10 's date value is larger than 30 days later of today. otherwise set it to be "true".

My question is how can we determine user.customproperty10's date value from string? and compare it with today's date? Looks it does not allow me to use new Date() or DateFormat classes in CreatAccountJSON.

Please share your idea and help me?

Thanks

2 REPLIES 2

rushikeshvartak
All-Star
All-Star

Please share createAccountJSON

Calendar.getInstance().getTime().compareTo(user.customproperty10) > 0

alc
Regular Contributor
Regular Contributor

Hello Rushikesh,

The user.customproperty10 is a String, but compareTo method need a Date object as argument.

How can you convert this customproperty10 from String to Date if you know its format is "yyyy-MM-dd" in CreateAccountJSON?

Thanks