When I use the web api to update a double field, and the new value is a integer (no decimal), the result becomes error with the following message.
Invalid Attribute Value Type for xxx. Expected: Double (either Decimal or Float or Money), Found: System.Int32
The code is as follows.
function updateRecordAttribute(col, recordObj) {
var attributeName = col.name,
value = recordObj[attributeName],
newValue = 5;
if (newValue != null && newValue !== value) {
appAjax('Updating...', {
type: "PUT",
url: "/_api/contacts(" + recordObj.id + ")/" + attributeName,
contentType: "application/json",
data: JSON.stringify({
"value": newValue
}),
success: function(res) {
table.updateRecord(attributeName, newValue, recordObj);
}
});
}
return false;
}
So, how can I save a integer value in the double field?
I have tried to parse the value to double through number() and parseFloat(), but the result have not changed.

Report
All responses (
Answers (