Visual Studio > New Project > Visual C# > Class Library (.NET Framework) > Give the Name of the project and also provide Solution. > Target Framwork should be .Net Framework 4.5.2
Tools > Manage Nuget Packages for solution > Search for Dynamics 365 and select Microsoft.crm.CoreAssemblies and Microsoft.crmSdk.XrmTooling.PluginRegistrationTool and install
API URL format - https://mydev.crm.dynamics.com/api/data/v9.1/zyme_incentivepaymentheaders(4CD2E071-3U73-AW11-J811-000D3A4F62E7)/Microsoft.Dynamics.CRM.my_CustomAction
To open the web resource with the parameters - === var myId = parent.Xrm.Page.getAttribute("new_id").getValue(); var webResource = "new_/Dialogs/MyHtml.html"; var customParameters = encodeURIComponent("myId=" + myId); Xrm.Utility.openWebResource(webResource, customParameters);
var entityId = getUrlVars()["entityId"]; var entityName = getUrlVars()["entitytypename"];
// Read a page's GET URL variables and return them as an associative array. function getUrlVars() { var vars = [], hash; var hashes = unescape(window.location.search.replace('?', '')); hashes = hashes.replace('Data=', '').replace('data=', '').split(','); for (var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; } Reference - https://vjcity.blogspot.com/2019/05/how-to-pass-and-retrieve-custom-data-to.html
Entity API Name: new_Tests Note: To query we should use the plural form, if the entity is alread ends with 's', we should as 'es'. For the above entity, It should be new_Testses.
Query on a custom entity - https://my.crm.dynamics.com/api/data/v9.1/new_Testses?$select=new_name&$top=1
Data Bind: Using ! for the boolean - https://stackoverflow.com/questions/10114472/is-it-possible-to-data-bind-visible-to-the-negation-of-a-boolean-viewmodel
Microsoft Dynamics 365 starting PDF -
ReplyDeletehttps://crmbook.powerobjects.com
Microsoft Dynamics field API Name is Case-Sensitive.
ReplyDeleteManaged Solutions Importing -
ReplyDeleteIf you are not overwriting the customizations while importing the package html and javaScript changes won’t be loaded.
For free MSD Account -
ReplyDeletehttps://trials.dynamics.com/
After sign up to login visit -
ReplyDeletehttps://portal.office.com
Open below url to login -
Deleteportal.office.com/adminportal/home
Once you login in to the above website, register for 30 days trial of Dynamics 365
ReplyDeleteOnce you register in the above website bookmark the url to login going forward.
ReplyDeleteDownload Visual studio Community -
ReplyDeletehttps://visualstudio.microsoft.com/vs/community/
Before creating the solution we should create Customization > Publishers --> Which is the company information responsible of managing the package.
ReplyDeleteGo to Settings > Solutions > Create a solution by populating publisher and the version.
ReplyDeleteAdd existing to add the existing entities and elements.
ReplyDeletePlugin is a Class Library.
ReplyDeleteFor the supported events -
ReplyDeletehttps://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/supported-messages-entities-plugin
Visual Studio > New Project > Visual C# > Class Library (.NET Framework) > Give the Name of the project and also provide Solution. > Target Framwork should be .Net Framework 4.5.2
ReplyDeleteTools > Manage Nuget Packages for solution > Search for Dynamics 365 and select Microsoft.crm.CoreAssemblies and Microsoft.crmSdk.XrmTooling.PluginRegistrationTool and install
ReplyDeleteon right > References and add In folder > Solution's > library >microsoft.xrm.sdk.dll
ReplyDeleteIn C# to inherit interface we use :
ReplyDeleteUse the below template code -
ReplyDeletehttps://github.com/satishreddyv/MyCRM/blob/master/MyPlugins/PluginTemplate.cs
Add System.ServiceModel for the References
ReplyDeletePlatform only pass entity attributes if there is a change, always we need to check if the attribute available in the collection.
ReplyDeleteTo register a class in new Assembly, the class should be public.
ReplyDeletePlugin Registration: Message Retrieve is responsible to invoke the class on opening the record.
ReplyDeleteTo see the meta data of the org (After Registering a step you can see this) -
ReplyDeletehttps://mydev.crm.dynamics.com/api/data/v9.1/$metadata
API URL format -
ReplyDeletehttps://mydev.crm.dynamics.com/api/data/v9.1/zyme_incentivepaymentheaders(4CD2E071-3U73-AW11-J811-000D3A4F62E7)/Microsoft.Dynamics.CRM.my_CustomAction
To open the web resource with the parameters -
ReplyDelete===
var myId = parent.Xrm.Page.getAttribute("new_id").getValue();
var webResource = "new_/Dialogs/MyHtml.html";
var customParameters = encodeURIComponent("myId=" + myId);
Xrm.Utility.openWebResource(webResource, customParameters);
How to retrieve them within webpage
ReplyDelete===
var entityId = getUrlVars()["entityId"];
var entityName = getUrlVars()["entitytypename"];
// Read a page's GET URL variables and return them as an associative array.
function getUrlVars()
{
var vars = [], hash;
var hashes = unescape(window.location.search.replace('?', ''));
hashes = hashes.replace('Data=', '').replace('data=', '').split(',');
for (var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
Reference -
https://vjcity.blogspot.com/2019/05/how-to-pass-and-retrieve-custom-data-to.html
Entity API Name: new_Tests
ReplyDeleteNote: To query we should use the plural form, if the entity is alread ends with 's', we should as 'es'. For the above entity, It should be new_Testses.
Query on a custom entity -
https://my.crm.dynamics.com/api/data/v9.1/new_Testses?$select=new_name&$top=1
Reference:
https://community.dynamics.com/365/f/dynamics-365-general-forum/378416/resource-not-found-for-the-segment-error-getting-custom-entity-from-common-data-service-web-api
https://mydev.crm.dynamics.com/api/data/v9.1/new_payments?$select=new_tid&$top=10&$filter=new_id eq '34335355' and new_tid eq '443434'
ReplyDeleteTo Query from the URL
DeleteData Bind: Using ! for the boolean -
ReplyDeletehttps://stackoverflow.com/questions/10114472/is-it-possible-to-data-bind-visible-to-the-negation-of-a-boolean-viewmodel
To hide or show the section in MSD.
ReplyDeletevar tab=Xrm.Page.ui.tabs.get(TabName);
Deletevar section = tab.sections.get(SectionName);
section.setVisible(true); // To show section
Reference: https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/156616/show-hide-sections-based-on-drop-down-value