This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getContact(id, callback) { | |
$.ajax({ | |
type: "GET", | |
contentType: "application/json; charset=utf-8", | |
datatype: "json", | |
url: Xrm.Page.context.getClientUrl() + "/XRMServices/2011/OrganizationData.svc/ContactSet(guid'" + contactId + "')", | |
beforeSend: function (XMLHttpRequest) { XMLHttpRequest.setRequestHeader("Accept", "application/json"); }, | |
async: true, | |
success: function (data, textStatus, xhr) { | |
callback(data.d); | |
}, | |
error: function (xhr, textStatus, errorThrown) { | |
console.error(errorThrown); | |
} | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sayHelloIfNameIsDave() { | |
var contactId = Xrm.Page.getAttribute("customerid").getValue()[0].id; | |
getContact(contactId, function(contact) { | |
if (contact.Firstname === "Dave") | |
alert("Hello"); | |
}); | |
} |
HI Dave,
ReplyDeleteNeed your expertise inputs on the CallBack URL which can be used to receive the response from third party REST async service?
The requirement is - we have a third party REST service which works Asynchronously. The request parameters for that service includes a callback URL along with other standard request parameters. Upon completion of request the response will sent back to Dynamics CRM via the CallBack URL.
How we can get that CallBack URL? Any guidance on this is highly appreciated! Thanks in Advance.