Hello there, im trying to retrieve user record fields from the phone call entity im using the below code and its not working, any help will be much appreciated
function onLoad ()
{
retrieveuserChannel();
}
function retrieveuserChannel()
{
debugger;
var user=Xrm.Page.getAttribute("ownerid").getValue();
var userChannel;
if (user!= null) {
"<fetch mapping='logical'>" +
"<entity name='systemuser'>" +
"<attribute name='new_channel' />" +
"<filter>" +
"<condition attribute='systemuserid' operator='eq' value='" + user[0].id + "' />" +
"</filter>" +
"</entity>" +
"</fetch>";
}
XrmSvcToolkit.fetch({
fetchXml: fetchXml,
async: false,
successCallback: function (result) {
if (result.entities.length > 0) {
userChannel = result.entities[0].new_channel;
if(userChannel != null)
{
alert("true");
}
}
},
errorCallback: function (error) {
throw error;
}
});
}