I have a Web Core application that accesses data from a XData server using a TXDataWebDataSet. I can associated data for the DataSet but have some issues. I set the datafield property of an association field and am unable to display its value. I am unable to display values from the associated table, I get a PUT error when I try to ApplyUpdates.
1) I cannot display the value of the data field associated with the join for the association.
a) When I use expand the TWebDBLabel value shows "[object]".
b) When I don't use expand the value is null.
How do I display the value of the field in the primary table (AccountNo in my example)?
2) I cannot find a way to display any of the values in the associated table even though I can see them in the JSON.
Can I specifiy a DataField value that will display the associated fields (AccountName in my example)?
3) I can make changes in the client but when I ApplyUpdates, I get this errror:
403 Forbidden on PUT /tms/xdata/renewals/api/requests(6789) HTTP/1.1
The documentation clearly says use TXDataWebDataSet.ApplyUpdates to write the results back to the server.
What needs to be done to resolve the 403 error?
Thanks
The data is loaded using a TXDataWebDataSet
RequestId := JS.toString(AuthService.TokenPayload.Properties['user']);
QueryStringText MyDataset.QueryString
:= '$filter=startswith(RequestNo,'+QuotedStr(RequestId)+')&$expand=AccountNo';
MyDataset.Load;
Manual Accessed Results
I removed JWT middleware from the server so I could manually test the query using:
Partial JSON returned:
{
"value": [
{
"$id": 1,
"REQUESTNO": 7689,
"IPADDRESS": "1.2.3.4",
"ACCOUNTNO": {
"$id": 2,
"ACCOUNTNO": 87654321,
"ACCOUNTNAME": "TEST ACCOUNT"
}
}
]
}