Thursday, February 18, 2016

Create Custom Page Based on Custom/OOB Entity

Hi All,

Today we got a Requirement to Create a Custom Page that should fetch data from Custom Entity and it should display the same in HTML

As per our Requirement we need to show page like below screen shots.

For this we need to have
         
1.   Name Field
2.   Url Field
3.   Image Field
4.   Description Field
5.   Order Field


Steps:


Create a Custom Entity and name it as new_CustomEntity, and create the fields
è New_name(String)
è New_URL(String)
è New_EntityImageUrl(Create as an OOB Entity Image)
è New_Description(Multi Line String)
è New_Order(Whole Nubmer)

Open Visual Studio and Add New HTML Page to the Solutions

Add the below Scripts
<script type="text/javascript" src="new_/SDK.REST.js"></script>
<script type="text/javascript" src="new_SDK.Metadata.js"></script>
<script type="text/javascript" src="new_GetOptionSetSDK.js"></script>
<script type="text/javascript" src="ClientGlobalContext.js.aspx"></script>
<script type="text/javascript" src="new_jquery1.4.1.min"></script>
<script type="text/javascript" src="new_FetchXMLQueries.js"></script>
<script type="text/javascript" src="new_XrmServiceToolkit"></script>

Above mentioned Scripts Used to load the JS into the Current page where the HTML page is loaded

new_FetchXMLQueries – we are Using FetchXML in this js file
new_XrmServiceToolkit – XRM tool KIT

<script type="text/javascript">
        var getSplit;

        var getallValuespagingValues = [];
        var relatedAccounts = [];
        var getCollectionRecords = new Array();
        function getRMWorkbenchValues() {
            context = GetGlobalContext();
            serverUrl = context.getClientUrl();
            userid = context.getUserId();
            ODataPath = serverUrl + "/xrmservices/2011/OrganizationData.svc/new_?$select=new_Order,new_URL,new_Description,new_name,EntityImage_URL&$orderby=CreatedOn%20asc";
            GetRecords(ODataPath);
        }
        function GetRecords(ODataPath) {
            jQuery.ajax({
                type: "GET",
                contentType: "application/json; charset=utf-8",
                datatype: "json",
                url: ODataPath,
                async: false,
                beforeSend: function (XMLHttpRequest) {
                    XMLHttpRequest.setRequestHeader("Accept", "application/json");
                },
                success: function (data, textStatus, XmlHttpRequest) {
                    if (data && data.d != null && data.d.results != null) {
                        AddRecordsToArray(data.d.results);
                        FetchRecordsCallBack(data.d);
                    }
                },
                error: function (XmlHttpRequest, textStatus, errorThrown) {
                    alert("Error :  has occured during retrieval of the records ");
                }
            });
        }
        function AddRecordsToArray(records) {
            for (var i = 0; i < records.length; i++) {
                var Generatetable = "<td>"
                Generatetable += "<table tabindex='0' style='cursor: hand;' id='_L" + records[i].new_Order + "' cellpadding='12' cellspacing='0' width='100%'>"
                Generatetable += "<tbody>"
                Generatetable += "<tr>"
                Generatetable += "<td width='48'>"
                Generatetable += "<img alt='' src=" + serverUrl + records[i].EntityImage_URL + " height='50' width='54'></a></td>"
                Generatetable += "<td style='padding-left: 2px;'><a target='_blank' class='linktitle ms-crm-Link' href='" + records[i].new_URL + "' id='_A" + records[i].new_Order + "'>" + records[i].new_name + "<br>"
                Generatetable += "</a>"
                Generatetable += "<div class='linkhelp' id='_I" + records[i].new_Order + "'>" + records[i].new_Description + "<a onclick='return false;' href='#'></a>"
                Generatetable += "</div>"
                Generatetable += "</td>"
                Generatetable += "</tr>"
                Generatetable += "</tbody>"
                Generatetable += "</table>"
                Generatetable += "</td>"
                relatedAccounts.push(Generatetable);
            }
        }

        function FetchRecordsCallBack(records) {
            if (records.__next != null) {
                var ODataPathh = records.__next;
                GetRecords(ODataPathh);
            }
        }

        function Getheader() {
            var head = GetHeader();
            document.getElementById("demo").innerHTML = head;
        }
        function GenerateTable() {
            getRMWorkbenchValues();
            //Create a HTML Table element.
            var table = document.createElement("TABLE");
            table.style = 'table-layout: fixed;';
            table.cellpadding = '0';
            table.cellspacing = '0';
            table.width = '100%';
            //Get the count of columns.
            var columnCount = relatedAccounts.length;

            //Add the data rows.
            for (var i = 0; i < relatedAccounts.length; i++) {
                var row = table.insertRow(-1);
                var cell1 = row.insertCell(0);
                var cell2 = row.insertCell(1);
                cell1.innerHTML = relatedAccounts[i];
                if (columnCount > i + 1) {
                    cell2.innerHTML = relatedAccounts[i + 1];
                    i++;
                }
            }

            var dvTable = document.getElementById("dvTable");
            dvTable.innerHTML = "";
            dvTable.appendChild(table);
            document.getElementById("getheader").innerHTML = (GetHeaderValue("Header"))[0].attributes.new_value.value;
            document.getElementById("getsubheader").innerHTML = (GetHeaderValue("SubHeader"))[0].attributes.new_value.value;
        }
    </script>

Import the HTML and attached JS and

Map the HTML in Sitemap.


Then Right Click Select Add Tile --> LCID = 1033 Title = Application then click Save and Update the Site Map

Create a Record in Custom Entity

(Eg)


Create Two Configuration Record
(Eg)


Now Try open the Application you can able to view below screen
Please find the Link to Download Managed and Unmanaged Solutions

Refresh SubGrid from Javascript MSCRM


Refresh the Subgrid from below query.

Xrm.Page.ui.controls.get("SubGridName").refresh();

Eg. Xrm.Page.ui.controls.get("deal").refresh();






Trigger a Plugin on Adding User or Removing User from Access Team

We can trigger a plugin on add/remove user from Access Team in CRM 2013 and 2015

SDK provided two messages for it
  1. AddUserToRecordTeam
  2. RemoveUserFromRecordTeam

AddUserToRecordTeam (Primary Entity as teamtemplate)



You will get input parameters as follows

Record -- Entity Reference object of the record
SystemUserId -- User which you want to remove
TeamTeamplateId -- Access Team Template Guid

For more information on input parameters check - AddUserToRecordTeamRequest Members

RemoveUserFromRecordTeam (Primary Entity as teamtemplate)

 

You will get input parameters as follows Check
  
Record -- Entity Reference object of the record
SystemUserId -- User which you want to remove
TeamTeamplateId -- Access Team Template Guid

Thursday, August 13, 2015

Import Same Database with Different Name in CRM 2011/13/15

Hi All,

Please find the SQL Script. Run the Script in the Imported Database\

DECLARE @OldOrganizationId uniqueidentifier, @NewOrganizationId uniqueidentifier
 -- The Old OrganizationId
 SET @OldOrganizationId = (SELECT TOP(1) OrganizationId FROM OrganizationBase)
 -- The New OrganizationId
 SET @NewOrganizationId = (SELECT NEWID())
 --PRINT @OldOrganizationId
 --PRINT @NewOrganizationId
 -- Table with all Found Columns with the OrganizationId
 DECLARE @FoundOrganizationIds TABLE (Id bigint identity(1,1), TableName nvarchar(max), ColumnName nvarchar(max), ColumnValue nvarchar(max))

 -- Table with all uniqueidentifier Columns in the Database
 DECLARE  @FoundUniqueIdentifierColumns TABLE(Id bigint identity(1,1), TableName nvarchar(max), ColumnName nvarchar(max))

 -- Search for all uniqueidentifier Columns in the Database
 INSERT INTO @FoundUniqueIdentifierColumns
 SELECT
   col.TABLE_NAME, col.COLUMN_NAME
 FROM
  INFORMATION_SCHEMA.TABLES tbl INNER JOIN
  INFORMATION_SCHEMA.COLUMNS col ON tbl.TABLE_NAME = col.TABLE_NAME
 WHERE
  tbl.TABLE_TYPE = 'BASE TABLE' AND
  col.DATA_TYPE IN ('uniqueidentifier')
 DECLARE @ColumnCount bigint
 SET @ColumnCount = (SELECT COUNT(*) FROM @FoundUniqueIdentifierColumns)
 -- PRINT CAST(@ColumnCount as nvarchar)

 DECLARE @Iterator bigint
 SET @Iterator = 1

 -- Look through all found uniqueidentifier for the Old OrganizationId Columns and Save the TableName/ColumnName in @FoundOrganizationIds
 WHILE @Iterator <= @ColumnCount
  BEGIN
   DECLARE @execsql nvarchar(max)
   DECLARE @TableName nvarchar(max)
   DECLARE @ColumnName nvarchar(max)
  
   SET @TableName = (SELECT TableName FROM @FoundUniqueIdentifierColumns WHERE Id = @Iterator)
   SET @ColumnName = (SELECT ColumnName FROM @FoundUniqueIdentifierColumns WHERE Id = @Iterator)
  
   --PRINT(@TableName)
   --PRINT(@@ColumnName)
  
   SET @execsql = 'SELECT DISTINCT ' + CHAR(39) + @TableName + CHAR(39) + ','
   SET @execsql = @execsql + CHAR(39) + @ColumnName + CHAR(39) + ','
   SET @execsql = @execsql + @ColumnName
   SET @execsql = @execsql + ' FROM '
   SET @execsql = @execsql + @TableName
   SET @execsql = @execsql + ' WHERE '
   SET @execsql = @execsql + @ColumnName
   SET @execsql = @execsql + ' = ' + CHAR(39) + CAST(@OldOrganizationId as varchar(50)) + CHAR(39)
  
   INSERT INTO @FoundOrganizationIds (TableName, ColumnName, ColumnValue)
   -- PRINT (@execsql)
   EXEC (@execsql)
  
   SET @Iterator = @Iterator + 1  
  END
 -- SELECT * FROM @FoundOrganizationIds
 DECLARE @ColumnIterator bigint, @ColumnTotal bigint
 SET @ColumnIterator = 1
 SET @ColumnTotal = (SELECT COUNT(id) FROM @FoundOrganizationIds)

 PRINT (@ColumnTotal)

 -- INSERT New Organization in the OrganizationTable with the new OrganizationId (Copy of the Old Organization but with the new Id)
 INSERT INTO [dbo].[OrganizationBase]
           ([OrganizationId]
           ,[Name]
           ,[UserGroupId]
           ,[PrivilegeUserGroupId]
           ,[FiscalPeriodType]
           ,[FiscalCalendarStart]
           ,[DateFormatCode]
           ,[TimeFormatCode]
           ,[CurrencySymbol]
           ,[WeekStartDayCode]
           ,[DateSeparator]
           ,[FullNameConventionCode]
           ,[NegativeFormatCode]
           ,[NumberFormat]
           ,[IsDisabled]
           ,[DisabledReason]
           ,[KbPrefix]
           ,[CurrentKbNumber]
           ,[CasePrefix]
           ,[CurrentCaseNumber]
           ,[ContractPrefix]
           ,[CurrentContractNumber]
           ,[QuotePrefix]
           ,[CurrentQuoteNumber]
           ,[OrderPrefix]
           ,[CurrentOrderNumber]
           ,[InvoicePrefix]
           ,[CurrentInvoiceNumber]
           ,[UniqueSpecifierLength]
           ,[CreatedOn]
           ,[ModifiedOn]
           ,[FiscalYearFormat]
           ,[FiscalPeriodFormat]
           ,[FiscalYearPeriodConnect]
           ,[LanguageCode]
           ,[SortId]
           ,[DateFormatString]
           ,[TimeFormatString]
           ,[PricingDecimalPrecision]
           ,[ShowWeekNumber]
           ,[NextTrackingNumber]
           ,[TagMaxAggressiveCycles]
           ,[TokenKey]
           ,[SystemUserId]
           ,[CreatedBy]
           ,[GrantAccessToNetworkService]
           ,[AllowOutlookScheduledSyncs]
           ,[AllowMarketingEmailExecution]
           ,[SqlAccessGroupId]
           ,[CurrencyFormatCode]
           ,[FiscalSettingsUpdated]
           ,[ReportingGroupId]
           ,[TokenExpiry]
           ,[ShareToPreviousOwnerOnAssign]
           ,[AcknowledgementTemplateId]
           ,[ModifiedBy]
           ,[IntegrationUserId]
           ,[TrackingTokenIdBase]
           ,[BusinessClosureCalendarId]
           ,[AllowAutoUnsubscribeAcknowledgement]
           ,[AllowAutoUnsubscribe]
           ,[Picture]
           ,[TrackingPrefix]
           ,[MinOutlookSyncInterval]
           ,[BulkOperationPrefix]
           ,[AllowAutoResponseCreation]
           ,[MaximumTrackingNumber]
           ,[CampaignPrefix]
           ,[SqlAccessGroupName]
           ,[CurrentCampaignNumber]
           ,[FiscalYearDisplayCode]
           ,[SiteMapXml]
           ,[IsRegistered]
           ,[ReportingGroupName]
           ,[CurrentBulkOperationNumber]
           ,[SchemaNamePrefix]
           ,[IgnoreInternalEmail]
           ,[TagPollingPeriod]
           ,[TrackingTokenIdDigits]
           ,[NumberGroupFormat]
           ,[LongDateFormatCode]
           ,[UTCConversionTimeZoneCode]
           ,[TimeZoneRuleVersionNumber]
           ,[CurrentImportSequenceNumber]
           ,[ParsedTablePrefix]
           ,[V3CalloutConfigHash]
           ,[IsFiscalPeriodMonthBased]
           ,[LocaleId]
           ,[ParsedTableColumnPrefix]
           ,[SupportUserId]
           ,[AMDesignator]
           ,[CurrencyDisplayOption]
           ,[MinAddressBookSyncInterval]
           ,[IsDuplicateDetectionEnabledForOnlineCreateUpdate]
           ,[FeatureSet]
           ,[BlockedAttachments]
           ,[IsDuplicateDetectionEnabledForOfflineSync]
           ,[AllowOfflineScheduledSyncs]
           ,[AllowUnresolvedPartiesOnEmailSend]
           ,[TimeSeparator]
           ,[CurrentParsedTableNumber]
           ,[MinOfflineSyncInterval]
           ,[AllowWebExcelExport]
           ,[ReferenceSiteMapXml]
           ,[IsDuplicateDetectionEnabledForImport]
           ,[CalendarType]
           ,[SQMEnabled]
           ,[NegativeCurrencyFormatCode]
           ,[AllowAddressBookSyncs]
           ,[ISVIntegrationCode]
           ,[DecimalSymbol]
           ,[MaxUploadFileSize]
           ,[IsAppMode]
           ,[EnablePricingOnCreate]
           ,[IsSOPIntegrationEnabled]
           ,[PMDesignator]
           ,[CurrencyDecimalPrecision]
           ,[MaxAppointmentDurationDays]
           ,[EmailSendPollingPeriod]
           ,[RenderSecureIFrameForEmail]
           ,[NumberSeparator]
           ,[PrivReportingGroupId]
           ,[BaseCurrencyId]
           ,[MaxRecordsForExportToExcel]
           ,[PrivReportingGroupName]
           ,[YearStartWeekCode]
           ,[IsPresenceEnabled]
           ,[IsDuplicateDetectionEnabled]
           ,[RecurrenceExpansionJobBatchInterval]
           ,[DefaultRecurrenceEndRangeType]
           ,[HashMinAddressCount]
           ,[RequireApprovalForUserEmail]
           ,[RecurrenceDefaultNumberOfOccurrences]
           ,[ModifiedOnBehalfBy]
           ,[RequireApprovalForQueueEmail]
           ,[AllowEntityOnlyAudit]
           ,[IsAuditEnabled]
           ,[RecurrenceExpansionSynchCreateMax]
           ,[GoalRollupExpiryTime]
           ,[BaseCurrencyPrecision]
           ,[FiscalPeriodFormatPeriod]
           ,[AllowClientMessageBarAd]
           ,[InitialVersion]
           ,[HashFilterKeywords]
           ,[NextCustomObjectTypeCode]
           ,[ExpireSubscriptionsInDays]
           ,[OrgDbOrgSettings]
           ,[PastExpansionWindow]
           ,[EnableSmartMatching]
           ,[MaxRecordsForLookupFilters]
           ,[BaseCurrencySymbol]
           ,[ReportScriptErrors]
           ,[RecurrenceExpansionJobBatchSize]
           ,[FutureExpansionWindow]
           ,[GetStartedPaneContentEnabled]
           ,[SampleDataImportId]
           ,[BaseISOCurrencyCode]
           ,[GoalRollupFrequency]
           ,[CreatedOnBehalfBy]
           ,[HashDeltaSubjectCount]
           ,[HashMaxCount]
           ,[FiscalYearFormatYear]
           ,[FiscalYearFormatPrefix]
           ,[PinpointLanguageCode]
           ,[FiscalYearFormatSuffix]
           ,[IsUserAccessAuditEnabled]
           ,[UserAccessAuditingInterval])
 SELECT
    @NewOrganizationId,
    [Name]
   ,[UserGroupId]
      ,[PrivilegeUserGroupId]
      ,[FiscalPeriodType]
      ,[FiscalCalendarStart]
      ,[DateFormatCode]
      ,[TimeFormatCode]
      ,[CurrencySymbol]
      ,[WeekStartDayCode]
      ,[DateSeparator]
      ,[FullNameConventionCode]
      ,[NegativeFormatCode]
      ,[NumberFormat]
      ,[IsDisabled]
      ,[DisabledReason]
      ,[KbPrefix]
      ,[CurrentKbNumber]
      ,[CasePrefix]
      ,[CurrentCaseNumber]
      ,[ContractPrefix]
      ,[CurrentContractNumber]
      ,[QuotePrefix]
      ,[CurrentQuoteNumber]
      ,[OrderPrefix]
      ,[CurrentOrderNumber]
      ,[InvoicePrefix]
      ,[CurrentInvoiceNumber]
      ,[UniqueSpecifierLength]
      ,[CreatedOn]
      ,[ModifiedOn]
      ,[FiscalYearFormat]
      ,[FiscalPeriodFormat]
      ,[FiscalYearPeriodConnect]
      ,[LanguageCode]
      ,[SortId]
      ,[DateFormatString]
      ,[TimeFormatString]
      ,[PricingDecimalPrecision]
      ,[ShowWeekNumber]
      ,[NextTrackingNumber]
      ,[TagMaxAggressiveCycles]
      ,[TokenKey]
      ,[SystemUserId]
      ,[CreatedBy]
      ,[GrantAccessToNetworkService]
      ,[AllowOutlookScheduledSyncs]
      ,[AllowMarketingEmailExecution]
      ,[SqlAccessGroupId]
      ,[CurrencyFormatCode]
      ,[FiscalSettingsUpdated]
      ,[ReportingGroupId]
      ,[TokenExpiry]
      ,[ShareToPreviousOwnerOnAssign]
      ,[AcknowledgementTemplateId]
      ,[ModifiedBy]
      ,[IntegrationUserId]
      ,[TrackingTokenIdBase]
      ,[BusinessClosureCalendarId]
      ,[AllowAutoUnsubscribeAcknowledgement]
      ,[AllowAutoUnsubscribe]
      ,[Picture]
      ,[TrackingPrefix]
      ,[MinOutlookSyncInterval]
      ,[BulkOperationPrefix]
      ,[AllowAutoResponseCreation]
      ,[MaximumTrackingNumber]
      ,[CampaignPrefix]
      ,[SqlAccessGroupName]
      ,[CurrentCampaignNumber]
      ,[FiscalYearDisplayCode]
      ,[SiteMapXml]
      ,[IsRegistered]
      ,[ReportingGroupName]
      ,[CurrentBulkOperationNumber]
      ,[SchemaNamePrefix]
      ,[IgnoreInternalEmail]
      ,[TagPollingPeriod]
      ,[TrackingTokenIdDigits]
      ,[NumberGroupFormat]
      ,[LongDateFormatCode]
      ,[UTCConversionTimeZoneCode]
      ,[TimeZoneRuleVersionNumber]
      ,[CurrentImportSequenceNumber]
      ,[ParsedTablePrefix]
      ,[V3CalloutConfigHash]
      ,[IsFiscalPeriodMonthBased]
      ,[LocaleId]
      ,[ParsedTableColumnPrefix]
      ,[SupportUserId]
      ,[AMDesignator]
      ,[CurrencyDisplayOption]
      ,[MinAddressBookSyncInterval]
      ,[IsDuplicateDetectionEnabledForOnlineCreateUpdate]
      ,[FeatureSet]
      ,[BlockedAttachments]
      ,[IsDuplicateDetectionEnabledForOfflineSync]
      ,[AllowOfflineScheduledSyncs]
      ,[AllowUnresolvedPartiesOnEmailSend]
      ,[TimeSeparator]
      ,[CurrentParsedTableNumber]
      ,[MinOfflineSyncInterval]
      ,[AllowWebExcelExport]
      ,[ReferenceSiteMapXml]
      ,[IsDuplicateDetectionEnabledForImport]
      ,[CalendarType]
      ,[SQMEnabled]
      ,[NegativeCurrencyFormatCode]
      ,[AllowAddressBookSyncs]
      ,[ISVIntegrationCode]
      ,[DecimalSymbol]
      ,[MaxUploadFileSize]
      ,[IsAppMode]
      ,[EnablePricingOnCreate]
      ,[IsSOPIntegrationEnabled]
      ,[PMDesignator]
      ,[CurrencyDecimalPrecision]
      ,[MaxAppointmentDurationDays]
      ,[EmailSendPollingPeriod]
      ,[RenderSecureIFrameForEmail]
      ,[NumberSeparator]
      ,[PrivReportingGroupId]
      ,[BaseCurrencyId]
      ,[MaxRecordsForExportToExcel]
      ,[PrivReportingGroupName]
      ,[YearStartWeekCode]
      ,[IsPresenceEnabled]
      ,[IsDuplicateDetectionEnabled]
      ,[RecurrenceExpansionJobBatchInterval]
      ,[DefaultRecurrenceEndRangeType]
      ,[HashMinAddressCount]
      ,[RequireApprovalForUserEmail]
      ,[RecurrenceDefaultNumberOfOccurrences]
      ,[ModifiedOnBehalfBy]
      ,[RequireApprovalForQueueEmail]
      ,[AllowEntityOnlyAudit]
      ,[IsAuditEnabled]
      ,[RecurrenceExpansionSynchCreateMax]
      ,[GoalRollupExpiryTime]
      ,[BaseCurrencyPrecision]
      ,[FiscalPeriodFormatPeriod]
      ,[AllowClientMessageBarAd]
      ,[InitialVersion]
      ,[HashFilterKeywords]
      ,[NextCustomObjectTypeCode]
      ,[ExpireSubscriptionsInDays]
      ,[OrgDbOrgSettings]
      ,[PastExpansionWindow]
      ,[EnableSmartMatching]
      ,[MaxRecordsForLookupFilters]
      ,[BaseCurrencySymbol]
      ,[ReportScriptErrors]
      ,[RecurrenceExpansionJobBatchSize]
      ,[FutureExpansionWindow]
      ,[GetStartedPaneContentEnabled]
      ,[SampleDataImportId]
      ,[BaseISOCurrencyCode]
      ,[GoalRollupFrequency]
      ,[CreatedOnBehalfBy]
      ,[HashDeltaSubjectCount]
      ,[HashMaxCount]
      ,[FiscalYearFormatYear]
      ,[FiscalYearFormatPrefix]
      ,[PinpointLanguageCode]
      ,[FiscalYearFormatSuffix]
      ,[IsUserAccessAuditEnabled]
      ,[UserAccessAuditingInterval]
  FROM
  [dbo].[OrganizationBase]
  WHERE
  OrganizationId = @OldOrganizationId
 
 -- Loop through the Found Columns and Update them with the new OrganizationId
 WHILE @ColumnIterator <= @ColumnTotal
  BEGIN
   DECLARE @CurrentTable nvarchar(max)
   DECLARE @CurrentColumn nvarchar(max)
  
   SET @CurrentTable = (SELECT TableName FROM @FoundOrganizationIds WHERE Id = @ColumnIterator)
   SET @CurrentColumn = (SELECT ColumnName FROM @FoundOrganizationIds WHERE Id = @ColumnIterator)
  
   --PRINT (@CurrentTable)
   --PRINT (@CurrentColumn)
  
   -- Skip the OrganizationBase table now, since we have allready added the new OrganizationId
   IF @CurrentTable <> 'OrganizationBase'
    BEGIN
     DECLARE @UpdateScript nvarchar(max)
     SET @UpdateScript = ' UPDATE ' + @CurrentTable + ' SET ' + @CurrentColumn + ' = ' + CHAR(39) + CAST(@NewOrganizationId as varchar(50)) + CHAR(39) + ' WHERE ' + @CurrentColumn + ' = ' + CHAR(39) + CAST(@OldOrganizationId as varchar(50))+ CHAR(39)
     -- PRINT (@UpdateScript)
     EXEC (@UpdateScript)
    END
   SET @ColumnIterator = @ColumnIterator + 1
  END

 -- Delete the Old Organization from the OrganizationBase
 DELETE FROM OrganizationBase WHERE OrganizationId = @OldOrganizationId

Day 5 - Show and Hide fields Based on Condition using JavaScript in MSCRM/Datave

  Introduction: In this blog we will see how to Show and Hide Fields based on Condition using JavaScript in MSCRM/ Dataverse Script: functio...