Hi All,
Can someone with better experience please help. I am trying to add a filter to the "Optionalattendees" field in appointment entity, the guid I am passing from webApi retrieve is saying the value passed is empty, but my webApi actually returns back 32 records. What I'm I doing wrong, my code is below :
function AppointmentOptionalAttendeesLookup(formContext) {
Xrm.WebApi.retrieveMultipleRecords("systemuser", "?$select=systemuserid").then(
function success(result) {
var userId = [];
for (var i = 0; i < result.entities.length; i++) {
userId.push(result.entities[i].systemuserid);
//userId++;
}
if (userId.length > 0) {
formContext.getControl("optionalattendees").addPreSearch(function () {
var filter = "<filter>" +
"<condition attribute='systemuserid' operator='in' value='" + userId + "'/></filter>";
formContext.getControl("optionalattendees").addCustomFilter(filter);
});
}
},
function (error) {
console.log(error.message);
return
});
}
The UserId is being passed. Cheers