hello,
I want to call web api on main function of my calendar but dont understanding how does not work ? help for call web api by json in javascript..
Thanx..
*This post is locked for comments
hello,
I want to call web api on main function of my calendar but dont understanding how does not work ? help for call web api by json in javascript..
Thanx..
*This post is locked for comments
Thank you Alex
Check your filter:
filter=createdon eq 2017-09-27T05:22:52Z
You are asking Web API for the phone calls that were created on the 27th of September, exactly at 05:22:52
It's not returning anything or it just throws some error?
I want display records of activity entity such as if phone calls actual start 2017-09-23 and actualend 2017-09-24 then it will show on custom calendar by web api.
function retrieveEntityActivity()
{
var clientURL=window.parent.Xrm.Page.context.getClientUrl();
var req = new XMLHttpRequest();
req.open("GET", clientURL + "/api/data/v8.2/phonecalls?$select=subject,phonenumber,actualstart,actualend,activitytypecode&$filter=createdon eq 2017-09-27T05:22:52Z", 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.Community.Display.V1.FormattedValue\"");
req.setRequestHeader("Prefer", "odata.maxpagesize=10");
req.onreadystatechange = function ()
{
if (this.readyState === 4)
{
req.onreadystatechange = null;
if (this.status === 200)
{
var results = JSON.parse(this.response);
var resultData=results.value;
for (var j = 0; j < resData.length; j++)
{
var subject = resultData[j]["subject"];
var activitytypecode = resultData[j]["activitytypecode"];
var createdon = resultData[j]["createdon"];
var actualstart=resultData[j]["actualstart"];
var actualend=resultData[j]["actualend"];
}
}
else
{
alert(this.statusText);
}
}
};
req.send();
}
Its my API , so How i call on my custom calendar to display records dynamically
Can you be more precise where you want to trigger your javascript function and example of web API call would help us to identify the problem too.
Have you tried using David Yack's framework - github.com/.../Xrm.Tools.CRMWebAPI
Hope this helps
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156