Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Getting "ReferenceError: Sdk is not defined

(0) ShareShare
ReportReport
Posted on by 17

Getting error on last third line @ }).call(Sdk), which is not defining Sdk, can anyone please help me...

-----

"use strict";
(function ()
{
this.tcc_EmailReportRequest = function (n, t, i, r, u, f)
{
function v(n)
{
if (n instanceof Sdk.Entity)
o = n;
else
throw new Error("Sdk.tcc_EmailReportRequest SourceEntity property is required and must be a Sdk.Entity.");
}
function y(n)
{
if (n instanceof Sdk.Entity)
s = n;
else
throw new Error("Sdk.tcc_EmailReportRequest ExecutingUserEntity property is required and must be a Sdk.Entity.");
}
function p(n)
{
if (typeof n == "string")
h = n;
else
throw new Error("Sdk.tcc_EmailReportRequest Reporturl property is required and must be a String.");
}
function w(n)
{
if (typeof n == "string")
c = n;
else
throw new Error("Sdk.tcc_EmailReportRequest BillToPersonId property is required and must be a String.");
}
function b(n)
{
if (typeof n == "string")
l = n;
else
throw new Error("Sdk.tcc_EmailReportRequest AttachmentFileName property is required and must be a String.");
}
function k(n)
{
if (typeof n == "string")
a = n;
else throw new Error("Sdk.tcc_EmailReportRequest EmailBody property is required and must be a String.");
}
function e()
{
return ["<d:request>", "<a:Parameters>", "<a:KeyValuePairOfstringanyType>", "<b:key>sourceEntity<\/b:key>", o == null ? '<b:value i:nil="true" />' : ['<b:value i:type="a:Entity">', o.toValueXml(), "<\/b:value>"].join(""), "<\/a:KeyValuePairOfstringanyType>", "<a:KeyValuePairOfstringanyType>", "<b:key>executingUserEntity<\/b:key>", s == null ? '<b:value i:nil="true" />' : ['<b:value i:type="a:Entity">', s.toValueXml(), "<\/b:value>"].join(""), "<\/a:KeyValuePairOfstringanyType>", "<a:KeyValuePairOfstringanyType>", "<b:key>reporturl<\/b:key>", h == null ? '<b:value i:nil="true" />' : ['<b:value i:type="c:string">', h, "<\/b:value>"].join(""), "<\/a:KeyValuePairOfstringanyType>", "<a:KeyValuePairOfstringanyType>", "<b:key>BillToPersonId<\/b:key>", c == null ? '<b:value i:nil="true" />' : ['<b:value i:type="c:string">', c, "<\/b:value>"].join(""), "<\/a:KeyValuePairOfstringanyType>", "<a:KeyValuePairOfstringanyType>", "<b:key>attachmentFileName<\/b:key>", l == null ? '<b:value i:nil="true" />' : ['<b:value i:type="c:string">', l, "<\/b:value>"].join(""), "<\/a:KeyValuePairOfstringanyType>", "<a:KeyValuePairOfstringanyType>", "<b:key>emailBody<\/b:key>", a == null ? '<b:value i:nil="true" />' : ['<b:value i:type="c:string">', a, "<\/b:value>"].join(""), "<\/a:KeyValuePairOfstringanyType>", "<\/a:Parameters>", '<a:RequestId i:nil="true" />', "<a:RequestName>tcc_EmailReport<\/a:RequestName>", "<\/d:request>"].join("")
}
if (!(this instanceof Sdk.tcc_EmailReportRequest))
{
return new Sdk.tcc_EmailReportRequest(n, t, i, r, u, f);
}
Sdk.OrganizationRequest.call(this);
var o = null, s = null, h = null, c = null, l = null, a = null;
typeof n != "undefined" && v(n);
typeof t != "undefined" && y(t);
typeof i != "undefined" && p(i);
typeof r != "undefined" && w(r);
typeof u != "undefined" && b(u);
typeof f != "undefined" && k(f);
this.setResponseType(Sdk.tcc_EmailReportResponse);
this.setRequestXml(e());
this.setSourceEntity = function (n)
{
v(n);
this.setRequestXml(e())
};
this.setExecutingUserEntity = function (n)
{
y(n);
this.setRequestXml(e())
};
this.setReporturl = function (n)
{
p(n);
this.setRequestXml(e())
};
this.setBillToPersonId = function (n)
{
w(n);
this.setRequestXml(e())
};
this.setAttachmentFileName = function (n)
{
b(n);
this.setRequestXml(e())
};
this.setEmailBody = function (n)
{
k(n);
this.setRequestXml(e())
};
};
this.tcc_EmailReportRequest.__class = !0;
this.tcc_EmailReportResponse = function (n)
{
function i(n)
{
var i = Sdk.Xml.selectSingleNode(n, "//a:KeyValuePairOfstringanyType[b:key='emailId']/b:value");
Sdk.Xml.isNodeNull(i) || (t = Sdk.Xml.getNodeText(i))
}
if (!(this instanceof Sdk.tcc_EmailReportResponse))
return new Sdk.tcc_EmailReportResponse(n);
Sdk.OrganizationResponse.call(this);
var t = null;
this.getEmailId = function ()
{
return t
};
i(n)
};
this.tcc_EmailReportResponse.__class = !0
}).call(Sdk)

Sdk.tcc_EmailReportRequest.prototype = new Sdk.OrganizationRequest;
Sdk.tcc_EmailReportResponse.prototype = new Sdk.OrganizationResponse;

*This post is locked for comments

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Getting "ReferenceError: Sdk is not defined

    Hi,

    When you say "Sdk.Entity" you re basiclly referencing another library which has this (SDK) namespace defined along with other functions & methods. You need to find that liabrary in your project/ crm and add reference to that as well along with your current liabrary.

    Hope this helps.

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.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,407 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans