Estimated Fees in India
₹ 100 to ₹ 500 per hour
Find Microsoft Dynamics Course Fees in your locality
Post your Learning Need
Get customized quotes and responses from Tutors
Choose & Learn from Tutor of your choice
₹ 100 to ₹ 500
No data available
No data available
₹ 100 to ₹ 500
No data available
No data available
Lesson Posted on 09/11/2020 Learn IT Courses/Computer Course/Training in Software application usage
Dialog Runbase Example in AX 2012
Shiva Kumar
A certified Microsoft Dynamics AX Lead developer/Senior/Technical Consultant 10+ years experience in...
class Runbase_Example extends RunBase
{
TransDate fromDate,toDate;
CustAccount custAccount;
DialogField dlgFromDate,dlgToDate,custDldField;
#define.CurrentVersion(1)
#localmacro.CurrentList
fromDate,toDate
#endmacro
}
protected Object dialog()
{
DialogRunbase dialog;
dialog = super();
dialog = super();
custDldField = dialog.addFieldValue(extendedTypeStr(CustAccount),custAccount);
dlgFromDate = dialog.addFieldValue(extendedTypeStr(TransDate),fromDate);
dlgToDate = dialog.addFieldValue(extendedTypeStr(TransDate),toDate);
return dialog;
}
public boolean getFromDialog()
{
boolean ret;
ret = super();
custAccount = custDldField.value();
fromDate = dlgFromDate.value();
toDate = dlgToDate.value();
return ret;
}
public container pack()
{
return [#CurrentVersion,#CurrentList];
}
public boolean unpack(container packedClass)
{
Version version = RunBase::getVersion(packedClass);
switch (version)
{
case #CurrentVersion:
[version,#CurrentList] = packedClass;
break;
default:
return false;
}
return true;
}
public static void main(Args args)
{
Runbase_Example runb = new Runbase_Example();
if(runb.prompt())
{
runb.run();
}
}
Lesson Posted on 13/06/2018 Learn IT Courses/Microsoft Training/Microsoft Azure Training
OAuth Authentication (without using ADAL) to Dynamics 365 using Azure Apps
Jayakar Reddy
â?¢ Implementation of MSCRM 2011, 2013, 2015,2016 and Dynamics 365 â?¢ Customizing MSCRM 2011, CRM 2013,...
Here I am going to show without using ADAL(active directory authentication library) how to get the authentication token and how to connect to CRM from a standalone HTML Page using the web-API.
I will not explain in detail about how to register an APP in azure and give it access to Dynamics CRM.
Use below code to get the OAuth token once you’re done with Azure app registration
var microsoftTokenUrl = "https://login.microsoftonline.com/4060bfe9-7199-xxxxxxx-xxxxxxx/oauth2/token"; //Add your endpoint URL
var clientId = "xxxxxxxx-9715-xxxx-xxxx-3a1fac0cc5fe"; // Add your app ID
var clientSecret = "xxxxxxMJTQmtu4V73cRyduZ6vS40AlkAtSxxxxxxx";//Add your Secret Key
var resource = "https://xxxxxxx.crm5.dynamics.com";//Add your CRM Url
var grantType = "client_credentials";
function GetAuthroisationToken() {
var token=null;
$.ajax({
url: microsoftTokenUrl,
type: "POST",
contentType: "application/x-www-form-urlencoded",
crossDomain: true,
dataType: "json",
async: false,
data: {
'resource': resource,
'client_id': clientId,
'client_secret': clientSecret,
'grant_type': grantType
},
beforeSend: function (XMLHttpRequest) {
XMLHttpRequest.setRequestHeader("Accept", "application/json");
},
success: function (data, textStatus, xhr) {
token= data.access_token;
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus);
}});
return token;
}
Here is the sample code to create the lead in CRM (Design your HTML as your wish)
var entity = {};
entity.subject = $("#subject").val();
entity.firstname = $("#fname").val();
entity.lastname = $("#lname").val();
var salutation = $("#title option:selected").val();
entity.address1_postalcode = $("#postalcode").val();
entity.address1_city = $("#city").val();
entity.address1_stateorprovince = $("#state").val();
entity.address1_country = $("#country").val();
entity.address1_line1 = $("#address").val();
entity.emailaddress1 = $("#email").val();
entity.telephone1 = $("#phone").val();
entity.companyname = $("#company").val();
entity.jobtitle = $("#function").val();
entity.leadsourcecode = 8;
var token = GetAuthroisationToken();
if(token!=null)
webApi_Create("leads", entity, false,token);
function webApi_Create(entityName,entityObject,isAsync,token)
{
var newEntityId = null;
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
datatype: "json",
url: resource + "/api/data/v8.2/" + entityName,
data: JSON.stringify(entityObject),
beforeSend: function (XMLHttpRequest) {
XMLHttpRequest.setRequestHeader("OData-MaxVersion", "4.0");
XMLHttpRequest.setRequestHeader("OData-Version", "4.0");
XMLHttpRequest.setRequestHeader("Accept", "application/json");
XMLHttpRequest.setRequestHeader("Authorization", "Bearer " + token);
},
async: isAsync,
success: function (data, textStatus, xhr) {
var uri = xhr.getResponseHeader("OData-EntityId");
var regExp = /\(([^)]+)\)/;
var matches = regExp.exec(uri);
newEntityId = matches[1];
if (newEntityId !== null)
alert("Record Created!");
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus + " " + errorThrown);
}
});
return newEntityId;
}
Lesson Posted on 13/06/2018 Learn IT Courses/MS Dynamics CRM
How to use FetchXml in CRM Web API
Jayakar Reddy
â?¢ Implementation of MSCRM 2011, 2013, 2015,2016 and Dynamics 365 â?¢ Customizing MSCRM 2011, CRM 2013,...
Here I am going to show how to use FetxhXML query to get the results from CRM Web API. below example shows how to get logged in user Security roles.
function getRoles(token) {
var req = new XMLHttpRequest();
var fetch = “<fetch version=’1.0′ output-format=’xml-platform’ mapping=’logical’ distinct=’true’>” +
“<entity name=’role’>” +
“<attribute name=’name’ />” +
“<attribute name=’businessunitid’ />” +
“<attribute name=’roleid’ />” +
“<order attribute=’name’ descending=’false’ />” +
“<link-entity name=’systemuserroles’ from=’roleid’ to=’roleid’ visible=’false’ intersect=’true’>” +
“<link-entity name=’systemuser’ from=’systemuserid’ to=’systemuserid’ alias=’ad’>” +
“<filter type=’and’>” +
“<condition attribute=’systemuserid’ operator=’eq-userid’ />” +
“</filter>” +
“</link-entity>” +
“</link-entity>” +
“</entity>” +
“</fetch>”;
$.ajax({
type: “GET”,
contentType: “application/json; charset=utf-8”,
datatype: “json”,
url: Xrm.Page.context.getClientUrl() + “/api/data/v8.2/roles?fetchXml=” + fetch,
beforeSend: function (XMLHttpRequest) {
XMLHttpRequest.setRequestHeader(“OData-MaxVersion”, “4.0”);
XMLHttpRequest.setRequestHeader(“OData-Version”, “4.0”);
XMLHttpRequest.setRequestHeader(“Accept”, “application/json”);
XMLHttpRequest.setRequestHeader(“Prefer”, “odata.include-annotations=\”*\””);
},
async: false,
success: function (data, textStatus, xhr) {
var results = data;
for (var i = 0; i < results.value.length; i++) {
var roleid = results.value[i][“roleid”];
var roleName = results.value[i][“name”];
}
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus + ” ” + errorThrown);
}
});
}
Have a question about Microsoft Dynamics Course Fees? Ask your question and get answers from top Tutors.
Create your FREE UrbanPro profile and grow your income!
Find best tutors for Microsoft Dynamics Course Classes by posting a requirement.
Get started now, by booking a Free Demo Class