Here is my complete code:
<html><head>
<script type="text/javascript" src="../../ClientGlobalContext.js.aspx"></script>
<script type="text/javascript" src="hld-kay-crmtst/.../new_FetchUtil"></script>
<script type="text/javascript" src="hld-kay-crmtst/.../new_Json2"></script>
<script type="text/javascript" src="hld-kay-crmtst/.../new_Jquery"></script>
<script type="text/javascript" src="hld-kay-crmtst/.../new_XrmServiceToolkit"></script>
<script type="text/javascript" src="hld-kay-crmtst/.../new_sdkRest"></script>
<script>
document.onreadystatechange = function () {
if (document.readyState == "complete") {
//id from the previous page into this html web resource
var id=getUrlParameter('Data');//geturlparameter is the function that ı et thr querystring parameter
var fetch= "<fetch version='1.0' mapping='logical'><entity name='account'>";
fetch += "<all-attributes />";
fetch += "<filter type='and'>";
fetch += "<condition attribute='new_anabayi' operator='eq' value='" + id + "' />";
fetch += "<condition attribute='statuscode' operator='eq' value='1' />";
fetch += "<condition attribute='customertypecode' operator='eq' value='7' />";
fetch += "</filter></entity></fetch>";
alert('fetchi geçti');
var fetchData = XrmServiceToolkit.Soap.Fetch(fetch);
}
}
function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
}
</script>
</head><body style="word-wrap: break-word;">
<input type="checkbox" checked="checked" id="chkMagaza">
<label id="lblMagaza"></label>
</body></html>
How can this code be written using oData?