![]() | |
Partial Input |
To modify existng resourses, the Patch verb is used combined with the Uri that identifies the resource. The Patch methods only require fields that are necessary to identify the resource and fields that are being modified to be passed in the request body. Fields that are not passed are left as is and are not blanked out. This allows for a reduced input message size. Furthermore, it is no longer neccessary to perform a Get call to perform an update that does not require knowledge of the existing values. This allows a decrease in the amount of SDK calls. Refer to Patch Sticky Notes for a code sample demonstrating updating only one field.
In contrast, the wcf update methods require the full object to be passed inorder to prevent existing fields from being blanked out. For WCF, it is recommended to perform a Get call to obtain all the existing values and pass in the entire returned object with modified values as input for the update call.
Note there is a distinction between passing in a property with a null value and not passing in the property. Passing in a property with a null value will attempt to assign the null value to the property. Not passing in the property will not attempt to override the existing value.
Even for Insert methods, there is a distinction between passing in a property with a null value and not passing in the property. Although, the difference is more subtle. Passing in a property with a null value will attempt to assign the null value to the property. Not passing in the property will default to a value or null value based on Epic behavior. Refer to Defaulting for more information on how defaulting works.
In contrast, the wcf insert methods could not distinguish whether the input desired to enter a null value or default. The WCF insert method would typically default in those cases. If the null input was actually desired, an integration would need to perform an additional update call to assign a null value.