R – Are required fields forced when updating while consuming CrmService

crmcruddynamics-crmweb services

MSCRM 4.0

When writing plugins, I have assumed that the required fields will always exist either in the Target image or the PreImage image.
But recently when coding an external application that consumes the CrmService, I realised that the service will allow a business entity (or dynamic entity) to be created using the 'Create' method, even if the required fields do not exist or contain a value.

Is this the case? Is there a way to force required fields when calling the Update method of the service? Does anyone know why this may not be the case? Can anyone shed some light on the issue? Will I have to manage these required fields myself?

Best Answer

There is no validation. That's why we need to make sure that those properties are filled properly with the valid value.

Proper validation rules need to be enforced at PreCreate event, so that you can throw InvalidPluginExecutionException to notify users that certain mandatory properties are not filled properly.

Related Topic