I have gone through many posts on here and I have not gotten any to work. So obviously I am doing something wrong.
I have 2 custom tables, new_pres_client (Pres_Client) & new_presclienthistory (Pres Client History)
I am attempting to create a record in the new_presclienthistory table when a change happens on the new_pres_client record.
If I just fill in the changes column it works fine, but when attempting to fill in the Lookup I get continuous errors.
function createClientHistory_OnSave() {
varcurID = Xrm.Page.data.entity.getId().slice(1,-1);
var newRecord =
{
"new_changes": "Some Random Text",
"new_client@odata.bind": "/new_pres_clients(" varcurID ")"
}
Xrm.WebApi.createRecord("new_presclienthistory", newRecord);
}
Error:
An error occurred while validating input parameters: Microsoft.OData.ODataException: An undeclared property 'new_client' which only has property annotations in the payload but no property value was found in the payload. In OData, only declared navigation properties and declared named streams can be represented as properties without values.
During my troubleshooting if I change the "new_client" to anything else I receive the same error.
Thank you for any assistance.