Posts

Showing posts from August, 2021

Copy Record from Parent to Child using Java Script Html along with jqgrid

 ////////////CopyQuote Javascript////////////////////////////// var getGUiDofSelectedRecord; var formContext; function OpenHTML(primaryControl) {     debugger;     formContext = primaryControl;     if (Xrm.Page.getAttribute("customerid") != null && Xrm.Page.getAttribute("customerid") != undefined) {         if (Xrm.Page.getAttribute("customerid").getValue() == null) {             alert("Please select the customer");             return;         }     }     var isEdit = true;     var alertButton = new Alert.Button();     alertButton.label = "Copy & Close";     alertButton.callback = onAlertCloseButtonClick;     var array = new Array();     array.push(alertButton);     if (isEdit) {         Alert.showWebResource("apy_CustoapyMLForAccountQuotePopulation", 1500, 700, "Copy Quote", array, null, true, 10);     }     else {         HideAlert();     } } function OpenHTMLHomeGrid(primaryControl, selectedId) {     g

Sample Table ofHTML with JqGrid

 <html> <head>     <script src="ClientGlobalContext.js.aspx" type="text/javascript"></script>     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>     <script src="/WebResources/ apy_/grid.locale_en.js" type="text/javascript"></script>     <script src="/WebResources/ apy_/jquery.jqgrid.min.js" type="text/javascript"></script>     <link href="/WebResources/ apy_bootstrap.css" rel="stylesheet" type="text/css">     <link href="/WebResources/ apy_/ui.jqgrid.css" rel="stylesheet" type="text/css">     <link href="/WebResources/ apy_/jquery_ui.css" rel="stylesheet" type="text/css">     <style>         .ui-jqgrid tr.jqgrow td {             white-space: normal !important;             height: auto;             width:

Basic Plugin Code in D365 using C#

 using System; using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Query; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Xrm.Sdk.Messages; using Microsoft.Xrm.Sdk.Metadata; namespace  apy.CWA.Arcese.Security {     public class PostOperationCreateQuote : IPlugin     {         public void Execute(IServiceProvider serviceProvider)         {             ITracingService tracingService = (ITracingService)serviceProvider.GetService(typeof(ITracingService));             IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));             IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));             IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);             Entity entity = null;             try             {                 if (context.I

FROM Date and Time should not be greater than TO Date and Time using JavaScript

 var flagDropOffFromdat = true; function dropOffFromdate(executionContext) {     var formContext = executionContext.getFormContext();     var dropoffFrom = formContext.getAttribute(" apy_dropoffdatetime").getValue();     if (dropoffFrom != null && dropoffFrom != undefined && dropoffFrom != "") {         if (formContext.ui.getFormType() === 1 && flagDropOffFromdat === true) {             //setTimeout(function () {             var nowUtc = new Date(dropoffFrom.getFullYear(), dropoffFrom.getMonth(), dropoffFrom.getDate(), 0, 0, 0);             formContext.getAttribute(" apy_dropoffdatetime").setValue(nowUtc);             formContext.getAttribute(" apy_dropoffdatetimeto").setValue(nowUtc);             //}, 1000);                  flagDropOffFromdat = false;         } else {             var dropofFromDate = new Date(dropoffFrom);             dropofFromDate.setMinutes(dropofFromDate.getMinutes());             formContext.getAttr