Error message: The property 'RequesterEmpID' does not exist on type 'SP.Data.XYZListItem'. Make sure to only use property names that are defined by the type.
I edited some of the list column names in SharePoint. after which I get this error. 'RequesterEmpID' is one of the list column which was renamed.
Code:
export function addDatatoSharepoint(props){
return dispatch => {
props.Web.lists.getByTitle('Listname').items.add({
RequesterName: props.FirstName + " " + props.LastName,
RequesterJobTitle: props.Title,
RequesterEmpID: props.EmpID,
RequesterDepartment: props.Department,
RequestDate: new Date().getDate(),
DocumentID: props.DocumentID,
}).then(r => {
console.log(r);
});
}
}