Sorry for so many posts
As I have been adding fields to the database, I have been hand tweaking the Entities definition on the server.
This has me puzzled. I have compared to the last update on my GIT repo. I cant see where I have gone wrong. Is it a Database issue or I have stuffed something up?
Even swagger gives me an error. This is when I do a get (for all records). Getting one record works fine.
{
"error": {
"code": "IdNotSetException",
"message": "Id not set on entity of class TStaff."
}
}
Expanded error from the app when fetching records to display on grid
{FMessage: 'XData server request error.\nUri: https://example…etException
Id not set on entity of class TStaff.', FHelpContext: 0, FJSError: Error: XData server request error.
Uri: https://example.com.au:2003/chopper/Staff?$top=10&$inl…, FStack: 'Error: XData server request error.
Uri: https://fl…rLoad (http://localhost:8000/ops/ops.js:56477:34)', FErrorResult: {…}}
FErrorResult
:
{FResponse: {…}, FRequestId: 'list', FErrorCode: 'IdNotSetException', FErrorMessage: 'Id not set on entity of class TStaff.', FRequestUrl: 'https://example.com.au:2003/chopper/Staff?$top=10&$inlinecount=allpages', …}
FHelpContext
:
0
FJSError
:
Error: XData server request error. Uri: https://example.com.au:2003/chopper/Staff?$top=10&$inlinecount=allpages Status code: 500 Error Code: IdNotSetException Id not set on entity of class TStaff. at Object.Create$1 (http://localhost:8000/ops/ops.js:3493:23) at Object.Create$2 (http://localhost:8000/ops/ops.js:57450:39) at c.$create (http://localhost:8000/ops/ops.js:359:19) at Object.DoError (http://localhost:8000/ops/ops.js:56855:57) at LocalSuccess (http://localhost:8000/ops/ops.js:57002:22) at LocalSuccess (http://localhost:8000/ops/ops.js:56332:23) at XMLHttpRequest.XhrLoad (http://localhost:8000/ops/ops.js:56477:34)
FMessage
:
"XData server request error.
Uri: https://example.com.au:2003/chopper/Staff?$top=10&$inlinecount=allpages\nStatus code: 500
Error Code: IdNotSetExceptio
nId not set on entity of class TStaff."
FStack
:
"Error: XData server request error.\nUri: https://example.com.au:2003/chopper/Staff?$top=10&$inlinecount=allpages
Status code: 500
Error Code: IdNotSetException
Id not set on entity of class TStaff.\n at Object.Create$1 (http://localhost:8000/ops/ops.js:3493:23)\n at Object.Create$2 (http://localhost:8000/ops/ops.js:57450:39)\n at c.$create (http://localhost:8000/ops/ops.js:359:19)\n at Object.DoError (http://localhost:8000/ops/ops.js:56855:57)\n at LocalSuccess (http://localhost:8000/ops/ops.js:57002:22)\n at LocalSuccess (http://localhost:8000/ops/ops.js:56332:23)\n at XMLHttpRequest.XhrLoad (http://localhost:8000/ops/ops.js:56477:34)"
[[Prototype]]
:
Object
I have attached my Entities file. I would be grateful for any pointers.
Srv_Entities.pas (54.2 KB)