0

In my code, I insert from one date field to another date field, then update my entity with the new data and debugging my code. I get this exception:

A validation error occurred.  The value of  on record of type is outside the valid range.

When I change the same field in CRM UI I get no error. Where should I look for? What is the problem?

Damkulul
  • 1,406
  • 2
  • 25
  • 59

1 Answers1

0

Normally this error will look like:

A validation error occurred. The value of 'field_name' on record of type 'entity_name' is outside the valid range.

You have to make sure, if the field is optionset - then the value (ex.10000000) passed in code is within the available range of options in optionset customization (ex: 10000000, 10000001, 10000002)

You said date field, verify if the date fields between the entities are of same type (like date only, date time, timezone specific, etc). Also the retrieval from CRM using SDK will give you UTC whereas the date value assignments in code while create/update will be parsed to UTC.. check that too for possible date range like 31st November 2017.