« Return to Thread: Setting a custom field in flowscript alters value of another field

Setting a custom field in flowscript alters value of another field

by Nick-89 :: Rate this Message:

Reply to Author | View in Thread

Hello All,

I've implemented a simple hit counter that adjusts a custom field ("HitCount")
on a document every time the document is refreshed. I'm doing this by calling an
extension that grabs the document, updates its hit count by calling:

document.setCustomField("HitCount", java.lang.Integer.parseInt(hits));
document.save();


On certain documents, I have a field called DocumentPostDate (not a custom
field, but one I defined in the Administration tab). This field contains a date
value that is set once when the document is created and then never adjusted.

The problem is, when I call setCustomField(), it (for some reason) is
decrementing the DocumentPostDate field. This happens no matter what custom
field I'm setting (I see the same problem if I change it to
document.setCustomField("NewField", "New Value")), and it stops happening as
soon as I comment out the call to setCustomField().

After some further testing with various fields, it looks like it always
decrements date values (but doesn't affect any other field types as far as I can
tell).

Does anybody have any clue what could be happening here?

Thanks in advance,

Nick


_______________________________________________
daisy community mailing list
Professional Daisy support: http://outerthought.org/en/services/daisy/support.html
mail to: daisy@...
list information: http://lists.cocoondev.org/mailman/listinfo/daisy

 « Return to Thread: Setting a custom field in flowscript alters value of another field