WinJS OData JSON -
try send data database web service error:
primitive values of type 'edm.decimal' , 'edm.int64' must quoted in payload. make sure value quoted
here code:
var newentry = { datum: entrydate, monat: parsefloat(entrymonth), taetigkeit: document.getelementbyid("addwork").value, total: parsefloat(document.getelementbyid("addtotal").value), totalv: parsefloat(document.getelementbyid("addtotalv").value), in_auswertung: 0, teil_projekt_id: parsefloat(document.getelementbyid("addsubproject").value), projekt_id: parsefloat(document.getelementbyid("addproject").value), timestamp: entrydate, sauftraggeber: document.getelementbyid("addcontractor").value, iidbenutzer: parsefloat(298),//sessionstorage.getitem("userid"), akt_id: parsefloat(document.getelementbyid("addactivity").value) }; winjs.xhr({ type: "post", url: requesturl, data: json.stringify(newentry), headers: { "content-type": "application/json" } }).then( function complete(response) { },
thanks marlowe
at least 1 of properties has declared type of edm.decimal
or edm.int64
. these values must serialized string (i.e., number wrapped in "
characters) in odata's json format. if you're not sure declared types of properties are, can entity type in server's $metadata
document (typically available @ http://.../myservice.svc/$metadata
).
so, property or properties edm.int64
or edm.decimal
, remove call parsefloat()
, keep string.
Comments
Post a Comment