RE: Link between ribbon button and web resource
Yes, you need Rest endpoints to retrieve the value from the configuration entity. Assuming your entity name is Configuration and you have 2 fields i.e. name & value then you can use the below script to retrieve the record with the name as "AppURL"
--------------------------------------------------
var req = new XMLHttpRequest();
req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/new_configurations?$select=new_configurationid,new_value&$filter=new_name eq 'AppURL'", true);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("Prefer", "odata.include-annotations=\"*\",odata.maxpagesize=1");
req.onreadystatechange = function() {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
var results = JSON.parse(this.response);
for (var i = 0; i < results.value.length; i++) {
// Your value will be returned here.
var new_value = results.value[i]["new_value"];
}
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send();
--------------------------------------------------
URL:
xxxx.crm.dynamics.com/.../new_configurations$select=new_configurationid,new_value&$filter=new_name eq 'AppURL'