Notifications
Announcements
No record found.
Hi all
I want to get records in my configuration page which is my .HTML page. What is the best way to do this in crm 2016.
Thank You
*This post is locked for comments
I am using this code and at contactRequest.status. it is giving me 500. I do not Where am I wrong.? Please help me to solve the issue.
function ShowConfiguration() {
debugger;
var serverUrl = window.parent.Xrm.Page.context.getClientUrl();
var oDataEndpointUrl = serverUrl + "/XRMServices/2011/OrganizationData.svc/";
//var query = "axp_mc_templateSet?$top=1";
var query = "webresourceset?$select=name&$filter=name eq 'apikey'";
oDataEndpointUrl += query;
var contactRequest = new XMLHttpRequest();
//contactRequest.open("GET", ODataPath + "/ContactSet(guid'" + contactId + "')", false);
contactRequest.open("GET", oDataEndpointUrl, false);
contactRequest.setRequestHeader("Accept", "application/json");
contactRequest.setRequestHeader("Content-Type", "application/json; charset=utf-8");
contactRequest.send();
if(contactRequest.status == 200)
{
var retrievedTemplate = JSON.parse(contactRequest.responseText).d;
var retrievedTemplateRecord = retrievedTemplate.results[0];
}
else
//console.log('request failed.');
//Xrm.Page.getAttribute('cobalt_contactsemail').setValue("---No Contact Found---");
Hi Abdul,
Can you try "WebResourceSet" instead of "webresourceset"?
If the case is not correct, you get HTTP 500 error.
Regards,
Charmis
Hi Charmis Varghese
Where did you this "information If the case is not correct, you get HTTP 500 error."? Your answer works for me.
I've built a tool which you can install into your organization to help build Odata queries such as this and will figure out the proper casing for elements in the request: https://github.com/jlattimer/CRMRESTBuilder/releases
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2