Posts

Showing posts from October, 2023

How to get and set data Types In JavaScript?

 How to get and set data Types In JavaScript? function changefield(executionContext) {     var formContext = executionContext.getFormContext();     //  Single line text Get     var name = formContext.getAttribute("new_name").getValue();      //  Single line text Set     formContext.getAttribute("new_name").setValue("bharath");     alert(name);     //phonenumber get     var mobile = formContext.getAttribute("new_mobile").getValue();     //phonenumber set     formContext.getAttribute("new_mobile").setValue("9078675645");     alert(mobile);     //two option get     var gender = formContext.getAttribute("new_gender").getValue();     //two option set     formContext.getAttribute("new_gender").setValue(true);     alert(gender);     //date get     var dob = formContext.getAttribute("new_dob").getV...

Create sales person lookup field in account and point to User entity. When ever user select the sales person lookup field value and save the account record, record need to share to the selected sales person.write a plugin to share the records

Image
Create sales person lookup field in account and point to User entity. When ever user select the sales person lookup field value and save the account record, record need to share to the selected sales person. Write a plugin to share the records? With Pre-Image concept ? Step 1: Create a look-up  filed in account entity as Sales Person and in that look-up  entity as user > next save and publish the account entity. Step 2: Write a plugin for giving share privilege  to particular user with the help of grant access and to remove share access from old user use pre image concept and revoke it . using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Crm.Sdk.Messages; using Microsoft.Xrm.Sdk; namespace AcessSales {     public class salesACC : IPlugin     {         public void Execute(IServiceProvider serviceProvider)         {   ...

How to get and set values in plugins?

  How to get and set values in plugins?   Ans.   using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Net.NetworkInformation; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Messages; using Microsoft.Xrm.Sdk.Metadata; namespace DatatypesPlugin {     public class UpdateData : IPlugin     {         public void Execute(IServiceProvider serviceProvider)                           {             IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));             IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));   ...

Call action by using plugin and JavaScript?

Image
Create a action, with input parameters  First Name and Last name, Out put Full name.  create a plugin on custom action call, read the inputs and prepare full name = First name + last Name. using System?  Send the output to action. Call this action from JavaScript , get the output and set fullname field value.  Trigger the JavaScript on- On save of your custom entity . Create FirstName, LastName and FullName Fields in your custom entity. Ans. Step1: For this fist need to create one action with 2 inputs and one output Step2: After creating action we need to prepare one plugin that combining the both fist name and last name using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Xrm.Sdk; namespace CallActionUsingPlugin {     public class fullName : IPlugin     {         public void Execute(IServiceProvider serviceProvider)         { ...