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

Question

Question

9017 error when trying to populate a date field with Workflow

asked on June 19, 2016 Show version history

Hi guys,

I'm wanting to update a template field with a date 1 year from the creation date of a newly created document.  I'm using a token calculator to generate the date and when tracking the token result I'm getting the correct format e.g. 20/06/2017 (NZ date format).  However when I try to assign the date to the field value I get the error "The data assigned to field 'Review Date' is not valid. 9017 [Bad field value ...etc]".  Assuming it's a formatting problem I've tried applying various formats to the token in the "Field Value" setting in the Assign Field Value activity via the token editor - currently displaying in the Workflow Assign Field Values as:

%(DateTokenCalculator_Add1Year#"d//MM//yyyy"#)

but I'm not having a lot of luck getting around the error.  I've changed the "Review Date" field to Text to see what format the date is entered in and it populates correctly via the workflow both with and without the formatting on the token, so the format generated by the Workflow looks to be fine, however every time I reset the field back to date type I get the error.

I've checked the server regional settings and all settings are for New Zealand, and as I confirmed when the field was configured as a text type, the date was entered correctly so it doesn't look to be an issue with the server settings, but that being the case I'm not sure where to look next.

What am I missing please?

Thanks,

Mike

0 0

Answer

SELECTED ANSWER
replied on June 20, 2016

Mike, does the Workflow Server service runs a a system user? Maybe Local System? Windows date settings are per user and system users might default to the US format.

1 0
replied on June 20, 2016

Thanks Miruna, I think I saw that as a resolution for another issue someone had posted so I've already got the (Workflow 10.0) service running with a local service account with server admin rights.

0 0
replied on June 20, 2016

Hi again Miruna, I think it may have been a service issue as after responding earlier I hardcoded the date in the assign field values and it worked, so I went through all the server settings to confirm they were correct (they were) then restarted the Workflow services and tested the original workflow and it worked without any errors.  I've made so many changes in testing to try to get it to work I'm not sure what the issue was, but I can only assume it had something to do with the service and the restart was what sorted it.  Thanks for that.

0 0

Replies

replied on June 20, 2016

I believe this has something to do with date format. 

Could you please try a sample date lets say 01/01/2015 and see if it works for both text and date. if it does then hopefully the error is with date format. it might be expecting month but you gave it date or something.

0 0
replied on June 20, 2016

Formatting fields only applies to viewing values, it has no impact on applications trying to set values.

0 0
replied on June 20, 2016

Thanks Junaid, I hadn't known about the formatting only applying to viewing values as Miruna has pointed out so I had tried that approach as well.  I hadn't thought about testing with a date that would work with both NZ and US formats though so I might give that a go with a hard-coded value and see if it makes any difference.

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

Sign in to reply to this post.