web
You’re offline. This is a read only version of the page.
close
Skip to main content
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 19

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

I have the same question (0)
  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans