You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have scenarios where we will update only specific attributes on the contact object. In those cases, we will populate only those required properties in the object. Currently ForceClient allows to set NullValueHandling as a whole not for specific attributes.
What if ForceClient update/upsert method takes a parameter for the list for fields that needs to be update as null and UpdateableContractResolver sets the property.NullValueHandling = NullValueHandling.Include for the property present in the parameter.
something like
public class UpdateableContractResolver : DefaultContractResolver
{
private List<string> fieldsToNull;
public UpdateableContractResolver(List<string> fieldsToNull)
{
this.fieldsToNull = fieldsToNull;
}
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
{
JsonProperty result = base.CreateProperty(member, memberSerialization);
if (fieldsToNull.Contains(result.PropertyName))
{
result.NullValueHandling = NullValueHandling.Include;
}
return result;
}
}
Is it possible to to? In this way, we will have the ability to update the specific fields to null in SF. mainly for DateTime field where we need to create it as string field in c# class to update as null
The text was updated successfully, but these errors were encountered:
We have scenarios where we will update only specific attributes on the contact object. In those cases, we will populate only those required properties in the object. Currently ForceClient allows to set NullValueHandling as a whole not for specific attributes.
What if ForceClient update/upsert method takes a parameter for the list for fields that needs to be update as null and UpdateableContractResolver sets the property.NullValueHandling = NullValueHandling.Include for the property present in the parameter.
something like
Is it possible to to? In this way, we will have the ability to update the specific fields to null in SF. mainly for DateTime field where we need to create it as string field in c# class to update as null
The text was updated successfully, but these errors were encountered: