You are viewing limited content. For full access, please sign in.

Question

Question

FieldValueCollection date field update

SDK
asked on October 15, 2015 • Show version history

We are having an issue with date and date/time field update with SDK9.2. Using JRA:

Document result = Document.create(...);

DateFormat format = new SimpleDateFormat("MM/dd/yyyy");

Date date = format.parse(oPropValue);

 

FieldValueCollection fvc = result.getFields();

fvc.assignTemplate(sometemplate);

fvc.set(oPropName, date);

result.setFields(fvc);

result.save(); --> Error bad field value.

 

Any answer is appreciated.

 

Thank you

 

0 0

Replies

replied on October 15, 2015

Hi Angie,

JRA accepts java.util.Calendar as the value of date field. The following is code snippet.

Calendar dateValue = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
dateValue.set(2015, 11, 15, 0, 0, 0);

FieldValueCollection fvc = result.getFields();
fvc.set(oPropName, dateValue);
result.setFields(fvc);
result.save();

 

0 0
replied on October 10, 2022

Hi Huazhen,

I am also facing the similar issue. I tried your solution but still the same error. 

Can you please help? 

 

Hi Angie,

Did you manage to resolve this issue? If yes, can you please share how. 

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.