Posts

Showing posts from July, 2023

Get and set using Plugin in MS Crm

 If you want to set up data immediately then go for the JavaScript. if you want to set or get the data on form save then use the plugin. in this post we will discuss about get and setting of data using plugin. Fist we discuss about getting the data. Single and multiple line of text: return type is string . string varname= targetobject.Contains(Schemaname)?(string ) targetobject[Schemaname]:null; Option set: return type is OptionSetvalue for getting the value of the option set OptionSetValue Varname= targetobject.Contains(Schemaname)?(OptionSetValue ) targetobject[Schemaname]:null; Varname.Value for the value reading Two Option Set return type is bool  bool Varname=  targetobject.Contains(Schemaname)?(bool ) targetobject[Schemaname]:null; Whole Number  return type is integer int Varname=  targetobject.Contains(Schemaname)?(int) targetobject[Schemaname]:null; Floating number and Decimal number return type is Dounble doubleVarname=  targetobject.Contains(Schemaname)?(double) targetobject[

Get and Set in MS Crm using JavaScript

  Getting the data from the form using JavaScript in the JavaScript, for every data type common to get the data. there some difference, in Crm we have following type of data types. we will discuss one by one. Single line of text, two option set, whole number, currency, decimal number, date and time, floating number, option set. for all these data types getting data is common. fist we need to create function with name like below for getValue return type is Number and for the getText return type is string  function nameoffunction (executionContext){ // it will get the all the form data var formContext = executionContext .getFormContext(); var variablename=  formContext. getAttribute("Filedschemaname").getValue(); // for getting the text of option set  var variablename=  formContext. getAttribute("Filedschemaname").getText(); } For the data type of lookup and customer we have a small chnage  var lookupId =   formContext. getAttribute ("fieldname").getValue()[

create one PCF control and embed into crm

Image
  create one PCF control and embed into Crm These pcf controls are the custom controls. we can create different control for the different data types in Crm. In this post we can discuss about numeric data type. For the creation, we require nodejs and power cli. Step1: Download the nodejs from the browser and install it. Stwp2: Open the Developer power shell for vs 2019 Step2: Check wheather app is installed or not. Enter the Below command node -v   .It will show the version of the node js Step3: Download and install the visual studio code. Step4: Download the Power Cli from the below link https://learn.microsoft.com/en-us/power-platform/developer/cli/introduction. Step4: its open like below and click install Step5: Go to file manager and create new one project folder Step6: Chnage the path by entering the below command cd Your file path. Step5: Validate the Power cli by entering the below command pac install latest it will show like below Enter the below command to instal our control to

Activating BPF stage using plugin based on the option set Present in the Form

Image
 Activating BPF stage using plugin For Each stage, Guid is available. we need to retrieve the each stage guid.  For retriving the guid we need to prepare the one url for the bpf. Step1: Developer resource url/ processstages$select=stagename&$filter=processid/workflowid eq B PF Guid.  After search, it will show like below and copy the all stage guids for further use. Step2: Prepare on bpf for the entity with adding some fields to bpf. Step3: Add the option set to from like below Step2: Prepare one class library project and add the necessary reference to project. After adding, follow the below code using Microsoft.Crm.Sdk.Messages; using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Query; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Week4Plugins {     public class Employbpfactivation : IPlugin     {         public void Execute(IServiceProvider serviceProvider)         {             IPluginExecutionContext

Connect MS Crm To Postman For Webapi Calls.

Image
 Connect MS Crm To Postman For Web api Calls. Step1: For the postman connection we need to create azure account with active directory in azure portal with Your Crm userid and password. Step2: Select the Azure active deprecatory and it will open below page And select the App registration i.e. available in the lest navigation Step3: After selecting it will open the and below page click on new app registration Step4: In the below page, we need to give the app name and redirected URL as localhost as Web and supported account for any organization and click on register Step5: After register copy the client id and paste it some where, for the future reference And click on manifest in left navigation Step6:Set the Auth URL As below for further use Step7: Change the below marked code and set as true for the both and click on save Step8: Select the Api Permission in left navigation and click on Add permission  Step9: After that select Dynamic Crm As api permission Step10: Select the user and