Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

JavaScript fetch xml

$
0
0

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;
}
});

}


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>