We had recently upgraded from CRM 3 to CRM 4. There were two issues we got stuck with.
One was following,
whenever we were saving our sales order form, we were receiving the following error
“One or more of the option values for this picklist are not in the range of allowed values”
However the same thing was working absolutely fine in CRM 3.
Finally we realized that this was because of one of the dummy picklist attribute. Dummy in a sense that for that attribute, values were being displayed using AddOption method of picklist and it had no corresponding (Data) Value defined.
So if a picklist field doesn’t have a corresponding data value defined for it , and if we try to save that form, it would throw this error “One or more of the option values for this picklist are not in the range of allowed values”. But only in case of CRM 4. In CRM 3, it would allow us to save the form.
And the second thing we realized was this,
Suppose we have a custom entity with the following attributes
Name (nvarchar) and Type (picklist) and we have defined a default value for the Type picklist attribute.
Now using CrmService.asmx Web Service if we are creating record of that particular entity and only specifying value for Name attribute,
a new record would get created with name specified by us and for the other picklist field, for which we didn’t specify anything while creating the record, it would have the default value for that picklist attribute set to it . However this would happen only in case of CRM 4.0
For CRM 3, a new record would get created but it would only contain the value for the Name field. The Type field would remain blank as we hadn’t defined any value for creating while creating the record using CrmService.
So in CRM 4, platform layer do take into considerationg the default value set for fields while the record is getting created using CrmService.