Wednesday, 24 June 2020

How to get Entity Metadata Using WEB API call in Dynamic CRM 365

As of now SDK.Metadata.js using the SOAP calls which are deprecated.
to get the Entities Metadata we should create and call a JavaScript function on the Onload event.

Below Function retrieve the all entities metadata of IsCustomizable eq to true.

function GetEntityMetadata() {
    var result;
    var apiQuery = Xrm.Utility.getGlobalContext().getClientUrl() + "/api/data/v9.1/" + "EntityDefinitions?$select=LogicalName,DisplayName,IsCustomizable&$filter=IsCustomizable/Value eq true";
    var entityList = ExecuteQuery(apiQuery);
    var localmetadataID = "";
    if (entityList != null) {
        for (var i = 0; i < entityList.length; i++)
        {
            var localName = entityList[i].LogicalName;
            if (localName == "contact") {
                localmetadataID = entityList[i].MetadataId;
            }
         
        }
    }
    //var entityAttributes=GetEntityAttributes(localmetadataID);
    alert(localmetadataID);
    return entityList;
}

function ExecuteQuery(apiQuery) {
    var results;
    $.ajax({
        type: "GET",
        contentType: "application/json; charset=utf-8",
        datatype: "json",
        url: apiQuery,
        async: false,
        beforeSend: function (xhr) {
            xhr.setRequestHeader("Accept", "application/json");
        },
        success: function (data, textStatus, xhr) {
            if (data.value != null && data.value.length) {
                results = data.value;
            }
        },
        error: function (xhr, textStatus, errorThrown) {
            if (xhr && xhr.responseText) {
                console.error('OData Query Failed: \r\n' + apiQuery + '\r\n' + xhr.responseText);
            }
            throw new Error(errorThrown);
        }
    });
    return results;
}


Get the All Attributes metadata

function GetEntityAttributes(entityMetadataId) {
    debugger;
   // var entitynamec = "contact";
    var apiQuery = Xrm.Utility.getGlobalContext().getClientUrl() + "/api/data/v9.1/" + "EntityDefinitions(" + entityMetadataId + ")?$select=LogicalName";

    apiQuery += "&$expand=Attributes($select=LogicalName,AttributeType,DisplayName;$filter=AttributeType ne Microsoft.Dynamics.CRM.AttributeTypeCode'Lookup' and AttributeType ne Microsoft.Dynamics.CRM.AttributeTypeCode'Customer')";

    var results;
    $.ajax({
        type: "GET",
        contentType: "application/json; charset=utf-8",
        datatype: "json",
        url: apiQuery,
        async: false,
        beforeSend: function (xhr) {
            xhr.setRequestHeader("Accept", "application/json");
        },
        success: function (data, textStatus, xhr) {
            if (data != null) {
                results = data;
            }
        },
        error: function (xhr, textStatus, errorThrown) {
            if (xhr && xhr.responseText) {
                console.error('API Query Failed: \r\n' + apiQuery + '\r\n' + xhr.responseText);
            }
            throw new Error(errorThrown);
        }
    });
    return results;
}

Friday, 30 August 2019

simple console

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xrm.Sdk;
using System.ServiceModel.Description;
using System.Net;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Crm.Sdk.Messages;


namespace ConnectingtoCRM
{
    class Program
    {
        static void Main(string[] args)
        {
          //  ClientCredentials credentials = new ClientCredentials();
          //  credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
          //  Uri OrganizationUri = new Uri("http://smdev-crm/SulekhaCRM/XRMServices/2011/Organization.svc");
          //  Uri HomeRealmUri = null;
          ////  using (Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy serviceProxy = new Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy(OrganizationUri, HomeRealmUri, credentials, null)) ;
            // Microsoft.Xrm.Sdk.IOrganizationService service = (Microsoft.Xrm.Sdk.IOrganizationService)serviceProxy;

            IOrganizationService organizationService = null;

            String username = "damodaram@demotrainingb.onmicrosoft.com";//eg: abc@xyz.onmicrosoft.com
            String password = "damu@123";//eg: password@123

            // Get the URL from CRM, Navigate to Settings -> Customizations -> Developer Resources
            // Copy and Paste Organization Service Endpoint Address URL
            String url = "https://demotrainingb.crm8.dynamics.com/main.aspx"; //eg: https://<yourorganisationname>.api.crm8.dynamics.com/XRMServices/2011/Organization.svc
            try
            {
                ClientCredentials clientCredentials = new ClientCredentials();
                clientCredentials.UserName.UserName = username;
                clientCredentials.UserName.Password = password;

                // For Dynamics 365 Customer Engagement V9.X, set Security Protocol as TLS12
                // ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

                organizationService = (IOrganizationService)new OrganizationServiceProxy(new Uri(url), null, clientCredentials, null);

                if (organizationService != null)
                {
                    Guid gOrgId = ((WhoAmIResponse)organizationService.Execute(new WhoAmIRequest())).OrganizationId;
                    if (gOrgId != Guid.Empty)
                    {
                        Console.WriteLine("Connection Established Successfully...");
                    }
                }
                else
                {
                    Console.WriteLine("Failed to Established Connection!!!");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception occured - " + ex.Message);
            }
            //return organizationService;

        }
    }
}

Saturday, 10 February 2018

add more options to filter&maps in Schedule Board Dynamics CRM 365 PSA

Story: Adding custom filter options to Filter&maps in schedule board in Dynamic 365 PSA

1. Navigate to Schedule Board



2. Double click on the "Initial Public View"
3. It will open the popup
4. Navigate to : Filter Layout
5. click on edit the Filter Layout
6. Sample code is available below

<?xml version="1.0" encoding="utf-8" ?>
<filter>
  <controls>
    <control type="characteristic" key="Characteristics" label-id="ScheduleAssistant.West.Skills" />
    <control type="combo" source="entity" key="Roles" inactive-state="1" label-id="ScheduleAssistant.West.Roles" entity="bookableresourcecategory" multi="true" />
    <control type="combo" source="entity" key="Territories" unspecified-key="UnspecifiedTerritory" label-id="ScheduleAssistant.West.Territories" entity="territory" multi="true" />
    <!--<control type="combo" source="entity" key="Countries"  label-id="Country" entity="new_country" multi="true" />-->
    <control type="combo" source="entity" key="SubRegions" inactive-state="1"  label-id="SubRegion" entity="new_subregion" multi="true" />
    <control type="combo" source="entity" key="Regions"  label-id="Region" entity="new_region" multi="true" />
    <control type="combo" source="entity" key="Marketid"  label-id="MarketID" entity="new_marketid" multi="true" />
    <control type="combo" source="entity" key="OrganizationalUnits" label-id="SB_FilterPanel_OrganizationalUnitsFilter_Title" inactive-state="1" entity="msdyn_organizationalunit" multi="true" />
    <control type="combo" source="optionset" key="ResourceTypes" label-id="SB_FilterPanel_ResourceTypesFilter_Title" entity="bookableresource" attribute="resourcetype" multi="true">
      <data>
        <value id="2" />
        <value id="3" />
        <value id="4" />
        <value id="5" />
      </data>
    </control>
    <control type="combo" source="entity" key="Teams" label-id="SB_FilterPanel_TeamsFilter_Title" entity="team" multi="true" />
    <control type="combo" source="entity" key="BusinessUnits" label-id="SB_FilterPanel_BusinessUnitsFilter_Title" entity="businessunit" multi="true" />
    <control type="order" key="Orders" label-id="FilterControl_OrderLabel">
      <order name="name" entity="bookableresource" attribute="name" />
      <order name="proficiencyscore" entity="bookableresourcecharacteristic" attribute="ratingvalue" />
    </control>
  </controls>
</filter>

7. Click on the edit retrieve resource query
<?xml version="1.0" encoding="utf-8" ?>
<bag xmlns:ufx="http://schemas.microsoft.com/dynamics/2017/universalfetchxml">
  <Resources ufx:source="fetch">
    <fetch mapping="logical" aggregate="true">
      <entity name="bookableresource">
        <attribute name="bookableresourceid" alias="bookableresourceid" groupby="true"/>
        <attribute name="name" alias="name" groupby="true"/>
        <attribute name="calendarid" alias="calendarid" groupby="true"/>
        <attribute name="resourcetype" alias="resourcetype" groupby="true"/>
        <attribute name="msdyn_startlocation" alias="startlocation" groupby="true"/>
        <!-- Let the database sort by name, unless we have characteristics - in which case we'll sort by the count of characteristics -->
        <order ufx:if="not($input/Characteristics/bag/characteristic)" alias="name" />

        <!-- Characteristic join -->
        <link-entity name="bookableresourcecharacteristic" from="resource" to="bookableresourceid" link-type="inner" ufx:if="$input/Characteristics/bag/characteristic">
          <attribute name="characteristic" aggregate="countcolumn" alias="characteristiccount" distinct="true" />
          <order alias="characteristiccount" descending="true" />

          <link-entity name="ratingvalue" from="ratingvalueid" to="ratingvalue" link-type="outer">
            <attribute name="value" aggregate="sum" alias="proficiencyscore" distinct="true" />
            <order alias="proficiencyscore" descending="true" />
          </link-entity>

          <filter>
            <condition attribute="statecode" operator="eq" value="0" />
          </filter>
        </link-entity>

        <!-- Characteristic filter -->
        <filter type="or" ufx:if="$input/Characteristics/bag/characteristic">
          <ufx:apply select="$input/Characteristics/bag">
            <filter type="and">
              <condition entityname="bookableresourcecharacteristic" attribute="characteristic" operator="eq">
                <ufx:value select="characteristic" attribute="value" />
              </condition>
              <condition entityname="ratingvalue" attribute="value" operator="ge" ufx:if="ratingvalue">
                <ufx:value select="ratingvalue" attribute="value" />
              </condition>
            </filter>
          </ufx:apply>
        </filter>

        <!-- Category join -->
        <link-entity name="bookableresourcecategoryassn" from="resource" to="bookableresourceid" link-type="inner" ufx:if="$input/Roles/bag">
          <attribute name="resourcecategory" aggregate="countcolumn" alias="rolecount" distinct="true" />

          <filter>
            <condition attribute="statecode" operator="eq" value="0" />
            <condition operator="in" attribute="resourcecategory">
              <ufx:apply select="$input/Roles/bag">
                <value>
                  <ufx:value select="@ufx-id" />
                </value>
              </ufx:apply>
            </condition>
          </filter>
        </link-entity>

        <!-- Territory join -->
        <link-entity ufx:if="$input/Territories/bag | $input/UnspecifiedTerritory[. = 'true']" name="msdyn_resourceterritory" from="msdyn_resource" to="bookableresourceid" alias="territory" link-type="outer">
          <filter>
            <condition attribute="statecode" operator="eq" value="0" />
            <condition attribute="msdyn_territory" operator="not-null" />
          </filter>
        </link-entity>

        <!-- Territory filter -->
        <filter type="or">
          <condition ufx:if="$input/UnspecifiedTerritory[. = 'true']" entityname="territory" attribute="msdyn_territory" operator="null" />

          <condition ufx:if="$input/Territories/bag" entityname="territory" attribute="msdyn_territory" operator="in">
            <ufx:apply select="$input/Territories/bag">
              <value>
                <ufx:value select="@ufx-id" />
              </value>
            </ufx:apply>
          </condition>
        </filter>

        <filter type="and">
          <condition attribute="statecode" operator="eq" value="0" />

          <!-- Preferred resource filter -->
          <condition ufx:if="$input/PreferredResources/bag" attribute="bookableresourceid" operator="in">
            <ufx:apply select="$input/PreferredResources/bag">
              <value>
                <ufx:value select="@ufx-id" />
              </value>
            </ufx:apply>
          </condition>

          <!-- Restricted resource filter -->
          <condition ufx:if="$input/RestrictedResources/bag" attribute="bookableresourceid" operator="not-in">
            <ufx:apply select="$input/RestrictedResources/bag">
              <value>
                <ufx:value select="@ufx-id" />
              </value>
            </ufx:apply>
          </condition>

          <!-- DisplayOnScheduleBoard and DisplayOnScheduleAssistant filter -->
          <condition attribute="msdyn_displayonscheduleboard" operator="eq" value="1" ufx:if="$input/DisplayOnScheduleBoard[. = 'true']" />
          <condition attribute="msdyn_displayonscheduleassistant" operator="eq" value="1" ufx:if="$input/DisplayOnScheduleAssistant[. = 'true']" />

          <!-- Organizational unit filter -->
          <condition operator="in" attribute="msdyn_organizationalunit" ufx:if="$input/OrganizationalUnits/bag">
            <ufx:apply select="$input/OrganizationalUnits/bag">
              <value>
                <ufx:value select="@ufx-id" />
              </value>
            </ufx:apply>
          </condition>

          <!-- country filter -->
          <!--<condition operator="in" attribute="new_country" ufx:if="$input/Countries/bag">
            <ufx:apply select="$input/Countries/bag">
              <value>
                <ufx:value select="@ufx-id" />
              </value>
            </ufx:apply>
          </condition>-->

          <!-- Sub Region filter -->
          <condition operator="in" attribute="new_subregion" ufx:if="$input/SubRegions/bag">
            <ufx:apply select="$input/SubRegions/bag">
              <value>
                <ufx:value select="@ufx-id" />
              </value>
            </ufx:apply>
          </condition>

          <!-- Region filter -->
          <condition operator="in" attribute="new_region" ufx:if="$input/Regions/bag">
            <ufx:apply select="$input/Regions/bag">
              <value>
                <ufx:value select="@ufx-id" />
              </value>
            </ufx:apply>
          </condition>

          <!-- MarketID filter -->
          <condition operator="in" attribute="new_marketid" ufx:if="$input/Marketid/bag">
            <ufx:apply select="$input/Marketid/bag">
              <value>
                <ufx:value select="@ufx-id" />
              </value>
            </ufx:apply>
          </condition>

          <!-- Resource type filter -->
          <condition attribute="resourcetype" operator="in" ufx:if="$input/ResourceTypes/bag/option">
            <ufx:apply select="$input/ResourceTypes/bag/option">
              <value>
                <ufx:value select="." />
              </value>
            </ufx:apply>
          </condition>
        </filter>

        <link-entity name="systemuser" from="systemuserid" to="userid" link-type="outer">
          <!-- If Business Units or Teams are supplied, assume only users are to be returned -->
          <ufx:value ufx:if="$input/BusinessUnits/bag | $input/Teams/bag" select="'inner'" attribute="link-type" />

          <attribute name="systemuserid" alias="systemuserid" groupby="true" />
          <attribute name="entityimage_url" alias="userimagepath" groupby="true"/>

          <!-- User and Teams filter -->
          <link-entity name="teammembership" from="systemuserid" to="systemuserid" link-type="inner" ufx:if="$input/Teams/bag">
            <filter type="and" >
              <condition operator="in" attribute="teamid">
                <ufx:apply select="$input/Teams/bag">
                  <value>
                    <ufx:value select="@ufx-id" />
                  </value>
                </ufx:apply>
              </condition>
            </filter>
          </link-entity>

          <!-- User Businessunits filter -->
          <filter type="and" ufx:if="$input/BusinessUnits/bag">
            <condition operator="in" attribute="businessunitid">
              <ufx:apply select="$input/BusinessUnits/bag">
                <value>
                  <ufx:value select="@ufx-id" />
                </value>
              </ufx:apply>
            </condition>
          </filter>
        </link-entity>

        <link-entity name="contact" from="contactid" to="contactid" link-type="outer">
          <attribute name="contactid" alias="contactid" groupby="true"/>
          <attribute name="entityimage_url" alias="contactimagepath" groupby="true"/>
        </link-entity>

        <link-entity name="account" from="accountid" to="accountid" link-type="outer">
          <attribute name="accountid" alias="accountid" groupby="true"/>
          <attribute name="entityimage_url" alias="accountimagepath" groupby="true"/>
        </link-entity>
      </entity>
    </fetch>

    <bag>
      <imagepath ufx:select="accountimagepath | contactimagepath | userimagepath" />

      <accountimagepath ufx:select="$null" />
      <contactimagepath ufx:select="$null" />
      <userimagepath ufx:select="$null" />
    </bag>
  </Resources>

  <Resources ufx:if="$input/Characteristics/bag/characteristic" ufx:select="list(Resources/bag[characteristiccount = count($input/Characteristics/bag/characteristic)])" />
  <Resources ufx:select="order(Resources, iif($input/Orders/bag, $input/Orders, 'name'))" />
</bag>
9. it should available like below

Thursday, 21 April 2016

Getting Form

How to get a form

function controlFormRibbon() {
   var formLabel;
   var currForm = Xrm.Page.ui.formSelector.getCurrentItem();
   formLabel = currForm.getLabel();

   //this code to show the ribbon if only the current opened form is Partner,
   //otherwise remain disable/hidden
   if (formLabel == "Partner") //change this with your own specific form name
   {
      return true;
   }
   else
   {
      return false;
   }
   //you can also apply the different/reverse rule here, for example you want to hide if form is Partner
}


http://missdynamicscrm.blogspot.in/2015/02/show-hide-ribbon-based-on-specific-form-in-multiple-forms-crm.html 

Wednesday, 12 August 2015

subgrid rows color change in crm 2015

hi

this is for how we will retrieve subgrid data..

first create one entity and place it as subgrid in another entity

take the name of it.here "voter"

use the following code in main form onload.

function getVoterEligibility() {
    debugger;
    // var grid = document.getElementById("voter");
    var grid = Xrm.Page.getControl("voter").getGrid();
    if (grid == null) {
        setTimeout(function () { getVoterEligibility(); }, 2000); //if the grid hasn’t loaded run this again when it has
        return;
    }

    var totalCount = grid.getTotalRecordCount();
    if (typeof totalCount == "number" && totalCount == 0) {
        setTimeout(getVoterEligibility, 1000, "voter");
        return;
    }
    else if (totalCount > 0) {
        grid.getRows().forEach(function (row, index) {

            var rowData = row.getData();
            // $(rowData).css("background-color", "green")
            if (rowData != null) {

                var rowDataRef = rowData.getEntity().getEntityReference();
                var id = rowDataRef.id;
                var name = rowDataRef.name;
                //  alert(name);
                var entityType = rowDataRef.entityType; //contact
                //get entity
                var entity = rowData.getEntity();

                if (entity != null) {
                    //get primary attribute value
                    var entityPrimaryAttrValue = entity.getPrimaryAttributeValue();
                    //get subgrid record entity name
                    var entityName = entity.getEntityName();
                    //get entity Id
                    var entityId = entity.getId();
                    //get attributes displayed on subgrid row
                    var entityAttrbs = entity.getAttributes();
                    //   var agevalue = entityAttrbs.get(1).getValue();

                    if (entityAttrbs.get(1).getValue() <= 20) {



                        $(grid.$3_1._element).find("tr[oid='" + id + "']").each(function () {
                            $(this).css("background-color", "green");

                        });



                    }

                    else {


                        $(grid.$3_1._element).find("tr[oid='" + id + "']").each(function () {
                            $(this).css("background-color", "Yellow");

                        });

                    }
                    //get entity reference
                    var entityRef = entity.getEntityReference();
                }

            }
        });
    }

}

Tuesday, 5 May 2015

Colors of data based on the values in Dashboard crm 2013


here we want to show the font colors based on the values.. Low , High, Medium .. like..




for this:
step 1 : need to create one HTML web resource..
and add it to here.

before creating the HTML need to check the dependent files are there or not..


download and add the .js files as webresources..

then use the below code.

follow the exact order of referenced files:

<!DOCTYPE html><html lang="en" xmlns="http://www.w3.org/1999/xhtml"><head>
    <meta charset="utf-8">
    <title></title>

</head><body>
        
      <!--  <script type="text/javascript" src="usmc_solutions/jquery.js"></script>
    <script type="text/javascript" src="usmc_solutions/XrmServiceToolkit.js"></script>
    <script type="text/javascript" src="usmc_solutions/json2.js"></script>-->
    
    <script type="text/javascript" src="hp_/Scripts/json2.js"></script>
    <script type="text/javascript" src="hppscm_/Scripts/JQueryLibrary.js"></script>
    <script type="text/javascript" src="hppscm_/Scripts/XrmServiceToolkitSOAP.js"></script>
    
      <style>
        .signout a:link {
            font-weight:normal;
            color:red;
        }

        .signin a:link {
            font-weight:bold;
            color:green;
        }
    </style>
       
    <table style="width: 100%;" id="myTable">
     
    </table>
  
        
    <script type="text/javascript">
        debugger;
        var varray = "";
        retireveSystemParameters();
       

        function retireveSystemParameters() {
            //retrieve records from system parameters.
            var _fetchXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +
                "<entity name='usmc_alert'>" +
                "<attribute name='usmc_alertid' />" +
                "<attribute name='usmc_priority' />" +
                "<attribute name='usmc_name' />" +
                "<attribute name='createdon' />" +
                "<order attribute='usmc_name' descending='false' />" +
                "</entity>" +
                "</fetch>";


            var FetchData = XrmServiceToolkit.Soap.Fetch(_fetchXML);
           
            var strURL = XrmServiceToolkit.Soap.GetServerURL();

            var entityname = "usmc_alert";

            if (FetchData != null) {

                var table = document.getElementById("myTable");

                var row = table.insertRow(0);
                var cell1 = row.insertCell(0);
                var cell2 = row.insertCell(1);
                cell1.innerHTML = "Name";

                cell2.innerHTML = "Priority";




                for (var i = 0; i < FetchData.length; i++) {

                    //  var table = document.getElementById("myTable");
                    row = table.insertRow(i + 1);
                    cell1 = row.insertCell(0);
                    cell2 = row.insertCell(1);
                    var names = FetchData[i].attributes.usmc_name.value;
                    var alertGuid = FetchData[i].attributes.usmc_alertid.value;
                    var Priority = FetchData[i].attributes.usmc_priority.formattedValue;
                    //  var urllink = "http://win-qctbmlihah0:5555/newtest/userdefined/edit.aspx?etc=10009&id=%7b"+alertGuid+"%7d";
                    //   var urllink = strURL + "/userdefined/edit.aspx?etc=10009&id=%7b" + alertGuid + "%7d";

                    var urllink = strURL + "/main.aspx?etc=10009&extraqs=%3f_gridType%3d10009%26etc%3d10009%26id%3d%257b" + alertGuid + "%257d%26rskey%3d%257b426407F0-4582-44F9-8D96-6EAF20E2F5BE%257d&pagemode=iframe&pagetype=entityrecord&rskey=%7b426407F0-4582-44F9-8D96-6EAF20E2F5BE%7d";
                    //  var urllink = strURL + "/main.aspx?etc=10086&extraqs=%3f_gridType%3d10086%26etc%3d10086%26id%3d%257b" + alertGuid + "%257d%26rskey%3d%257b426407F0-4582-44F9-8D96-6EAF20E2F5BE%257d&pagemode=iframe&pagetype=entityrecord&rskey=%7b426407F0-4582-44F9-8D96-6EAF20E2F5BE%7d"; 

                    //   cell1.innerHTML = '<a id="nv" href ="' + urllink + '" style="text-decoration:none;" style="color:red" name="link">' + names + '</a>';
                    cell2.innerHTML = Priority;
                    //  table.cell1.href = "http://www.google.com";
                    if (cell2.innerHTML == 'High') {

                        document.getElementById("myTable").rows[i + 1].style.color = "#ffd700";
                        cell1.innerHTML = '<a id="nv" href ="' + urllink + '" style="color:#ffd700;text-decoration:none;" name="link">' + names + '</a>';
                        //  document.getElementById("myTable").rows[i + 1].style.backgroundColor = "#FFCC99";
                        //document.getElementById("nv").link.style.color = "red";
                    }
                    if (cell2.innerHTML == 'Low') {

                        cell1.innerHTML = '<a id="nv" href ="' + urllink + '" style="color:green;text-decoration:none;" name="link">' + names + '</a>';
                        //   document.getElementById("myTable").rows[i + 1].style.backgroundColor = "#99FF99";
                        document.getElementById("myTable").rows[i + 1].style.color = "green";

                    }
                    if (cell2.innerHTML == 'Critical') {

                        cell1.innerHTML = '<a id="nv" href ="' + urllink + '" style="color:red;text-decoration:none;" name="link">' + names + '</a>';
                        // document.getElementById("myTable").rows[i + 1].style.backgroundColor = "#FFFFCC";
                        document.getElementById("myTable").rows[i + 1].style.color = "red";
                    }
                    if (cell2.innerHTML == 'Informational') {

                        cell1.innerHTML = '<a id="nv" href ="' + urllink + '" style="color:bule;text-decoration:none;" name="link">' + names + '</a>';
                        // document.getElementById("myTable").rows[i + 1].style.backgroundColor = "#99CCFF";
                        document.getElementById("myTable").rows[i + 1].style.color = "bule";
                    }

                }


            }

        }
        function GetObjectTypeCode(entityName) {
            try {
                var lookupService = new RemoteCommand("LookupService", "RetrieveTypeCode");
                lookupService.SetParameter("entityName", entityName);
                var result = lookupService.Execute();

                if (result.Success && typeof result.ReturnValue == "number") {
                    return result.ReturnValue;
                }
                else {
                    return null;
                }
            }
            catch (ex) {
                throw ex;
            }
        }

        </script>

    
</body></html>


step 2: add this webresource to the Dashboard

changes : check the URL for redirect.

Wednesday, 18 March 2015

SSRS Dates

hi

if we want to change the DateTime to Short date.. we will get null value as 01/01/0001
this is default value of Date.

need to use IIF condition for this.

=iif(isnothing(Fields!Confirmed_Check_In_Date.Value),"",FormatDateTime(Fields!Confirmed_Check_In_Date.Value, DateFormat.ShortDate))

Thursday, 12 March 2015

simple plug-in in crm 2013

for the simple plugin..

just open the class library:

add the required references

add the below code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using  Microsoft.Xrm.Sdk;
using  Microsoft.Xrm.Client;
using  Microsoft.Crm.Sdk.Messages;

namespace NamePlugin
{
    public class Class1 : IPlugin
    {
        public IOrganizationService service;
        public IPluginExecutionContext context;

        public void Execute(IServiceProvider serviceProvider)
        {
            IPluginExecutionContext context = (IPluginExecutionContext)
            serviceProvider.GetService(typeof(IPluginExecutionContext));

            Entity entity;

            // Check if the input parameters property bag contains a target
            // of the create operation and that target is of type Entity.
            if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
            {

                // Obtain the target business entity from the input parameters.
                entity = (Entity) context.InputParameters["Target"];

                string firstname = entity.Attributes["new_name"].ToString();
                string secondname = entity.Attributes["new_name1"].ToString();
                string fullname = firstname + " " + secondname;
                entity.Attributes["new_name2"] = fullname;
            }

        }
    }
}

this is simple and register it in per-operation



Wednesday, 11 March 2015

Enable trace in CRM

how to enable trace services in Dynamic CRM

first

in run .. regedit


then navigate to the









Wednesday, 26 November 2014

Meta Data in DropDown List in CRM 2013

Hi,

this page explains how we can bring and show the metadata in dropdown list(in HTML page).

1. Download the latest SDK.

go to : SDK\SampleCode\JS\SOAPForJScript\SOAPForJScript\Scripts

   check SDK.MetaData.js is there or not..
if yes :

2. Create a javascript webresource with name of : SDK.MetaData
   example : new_/Scripts/SDK.MetaData.js (use same formate for naming)

3. attach the SDK.MetaData.js from bin folder.

4. now create a HTML webresource with name of : /MetaDataDemo.htm

example : new_/MetaDataDemo.htm (use same format for naming).

5. attach the file : SDK\SampleCode\JS\SOAPForJScript\SOAPForJScript\MetaDataDemo.htm

here you will see the start button.. by clicking on this we will get entities, by clicking on entity we will get attributes.

now need to modify according to our requirement.

copy paste this code on the html webresource;

<!DOCTYPE html>
<!--
This file is part of the Microsoft Dynamics CRM SDK code samples.

Copyright (C) Microsoft Corporation.  All rights reserved.

This source code is intended only as a supplement to Microsoft
Development Tools and/or on-line documentation.  See these other
materials for detailed information regarding Microsoft code samples.

THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
-->
<!--<snippetMetaDataDemo>-->
<html lang="en-US">
<head>
    <title>Metadata Demonstration</title>
    <script src="../ClientGlobalContext.js.aspx" type="text/javascript"></script>
    <script src="hppscm_/Scripts/SDK.MetaData.js" type="text/javascript"></script>
    <script type="text/javascript">
        // An unordered list element to add Entity list items to
        var results;
        // An area to display messages
        var message;

        // Alert flag to indicate the changes
        // var alertFlag;

        function startSample() {
            ///<summary>
            /// Initializes the sample when the document is ready
            ///</summary>
            //Assign the global variables
            results = document.getElementById("results");
            message = document.getElementById("message");
            //    alertFlag = document.getElementById("dispalert");
            // document.getElementById("btnstartSample").setAttribute("disabled", "disabled");
            //Retrieve entities
            window.parent.SDK.Metadata.RetrieveAllEntities(window.parent.SDK.Metadata.EntityFilters.Entity,
             false,
             successRetrieveAllEntities,
             errorRetrieveAllEntities);
            // setText(message, "Loading...");

        }
        function btnSubmitValues() {
            var placeHValue = document.getElementById("placeholder");
            var dropdValue = document.getElementById("attributeselect");
            var EntityList= document.getElementById("entityselect");
            var seletedvalue = dropdValue.options[dropdValue.selectedIndex].text;
            var entityselectevalue = EntityList.options[EntityList.selectedIndex].text;
          //  var merge = placeHValue.value + seletedvalue;

            var Xrm;
            if (window.opener) { Xrm = window.opener.Xrm; }
            else if (window.parent) { Xrm = window.parent.Xrm; }
            var Formname = Xrm.Page.getAttribute("hppscm_name").getValue();
            var FormField = Xrm.Page.getAttribute("hppscm_field").getValue();

            Xrm.Page.getAttribute("hppscm_name").setValue(placeHValue.value);
            Xrm.Page.getAttribute("hppscm_field").setValue(seletedvalue);
            Xrm.Page.getAttribute("hppscm_entity").setValue(entityselectevalue);
           // alert(merge);

        }

        function successRetrieveAllEntities(entityMetadataCollection) {
            ///<summary>
            /// Receives the data from SDK.Metadata.RetrieveAllEntities and
            /// appends a list item to results for each one.
            ///</summary>

            entityMetadataCollection.sort(function (a, b) {
                if (a.LogicalName < b.LogicalName)
                { return -1 }
                if (a.LogicalName > b.LogicalName)
                { return 1 }
                return 0;
            });

            var EntityDropdown = document.getElementById('entityselect');
            var totalfields = entityMetadataCollection.length;
            var optionsList = new Array(totalfields);

            for (var i = 0; i < entityMetadataCollection.length; i++) {

                var entity = entityMetadataCollection[i];
                var entityNode = document.createElement("li");
                var entitySpan = document.createElement("span");

                setText(entitySpan, entity.SchemaName);
                entitySpan.id = entity.LogicalName;
                optionsList[i] = entity.LogicalName;
                entitySpan.title = "Click to Retrieve Attributes.";
                entitySpan.attributesRetrieved = false;
                // Add the event handler to retrieve attributes
                if (entity.LogicalName == "hppscm_visaapplication") {
                    entitySpan.onload = retrieveAttributes;
                   // EntityDropdown.options[i].selected=true;
                    entitySpan.onclick = retrieveAttributes;
                    entitySpan.style.cursor = "pointer";

                   // entityNode.appendChild(entitySpan);
                   // results.appendChild(entityNode);
                }
            }

            for (var i = 0; i < optionsList.length; i++) {
                option = new Option(optionsList[i], optionsList[i]);
                EntityDropdown.appendChild(option);// = option;
                if(optionsList[i]=="hppscm_visaapplication")
                {
                    EntityDropdown.options[i].selected = true;
                }
            }

            //setText(message, entityMetadataCollection.length +
            //" entities retrieved. Click each entity to retrieve the entity attributes.");

            retrieveAttributes();
        }
        function errorRetrieveAllEntities(error) {
            ///<summary>
            /// Displays the error returned from  SDK.Metadata.RetrieveAllEntities if it fails.
            ///</summary>
            setText(message, error.message);

        }

        function retrieveAttributes() {
            ///<summary>
            /// Retrieves attributes for the entity list item that is clicked
            ///</summary>
            //  if (this.attributesRetrieved == false) {
            var EntityList = document.getElementById("entityselect");
            //var seletedvalue = dropdValue.options[dropdValue.selectedIndex].text;
            var entityselectevalue = EntityList.options[EntityList.selectedIndex].text;
            var entityLogicalName = entityselectevalue;//this.id;
                // Display an entity list item level notification while retrieving data.
                var notification = document.createElement("span");


                setText(notification, "   Retrieving attributes for " + entityLogicalName + "...");
                notification.id = entityLogicalName + "Notification";
              //  entityLogicalName.parentElement.appendChild(notification);

                window.parent.SDK.Metadata.RetrieveEntity(window.parent.SDK.Metadata.EntityFilters.Attributes,
                entityLogicalName,
                null,
                false,
                function (entityMetadata) { successRetrieveEntity(entityLogicalName, entityMetadata); },
                errorRetrieveEntity);


           // }
            //this.attributesRetrieved = true;
          //  this.title = "";
        }

        function successRetrieveEntity(logicalName, entityMetadata) {
            ///<summary>
            /// Retrieves attributes for the entity list item that is clicked
            ///</summary>

            // Update the entity list item notification when data is retrieved.

            entityMetadata.Attributes.sort(function (a, b) {
                if (a.LogicalName < b.LogicalName)
                { return -1 }
                if (a.LogicalName > b.LogicalName)
                { return 1 }
                return 0;
            });

            //var notification = setText(document.getElementById(logicalName +
            //"Notification"), "   Retrieved " + entityMetadata.Attributes.length + " attributes.");

            var attributeList = document.createElement("ul");
            var dropdownlist = document.getElementById('attributeselect');
            var totalfields = entityMetadata.Attributes.length;
            var optionsList = new Array(totalfields);

            for (var i = 0; i < entityMetadata.Attributes.length; i++) {
                var attribute = entityMetadata.Attributes[i];
                var attributeNode = document.createElement("li");
                setText(attributeNode, attribute.SchemaName);
                attributeList.appendChild(attributeNode);
                optionsList[i] = attribute.SchemaName;

            }

            for (var i = 0; i < optionsList.length; i++) {
                option = new Option(optionsList[i], optionsList[i]);
                dropdownlist.appendChild(option);// = option;
            }

            //for (i = 0; i < attributeList.childNodes.length; i++)
            //{
            //    var opt = document.createElement("option");
            //    opt.text = attributeList.childNodes[i].innerText;
            //    opt.value = i;
            //    dropdownlist.appendChild(opt);

            //}
            // Access the entity list item element
      //      var entityNode = document.getElementById(logicalName).parentElement;

            // entityNode.appendChild(attributeList);
            // entityNode.attributesDisplayed = true;
            // Attach event handler to toggle display of attributes.
         //   entityNode.firstChild.onclick = toggleDisplayAttributes;
         //   entityNode.firstChild.title = "Click to hide attributes.";

        }
        function errorRetrieveEntity(error) {
            ///<summary>
            /// Displays the error returned from SDK.Metadata.RetrieveEntity if it fails.
            ///</summary>
            setText(message, error.message);

        }

        function toggleDisplayAttributes() {
            ///<summary>
            /// toggles whether the list of attributes is displayed.
            ///</summary>

            if (this.parentElement.attributesDisplayed) {
                this.parentElement.lastChild.style.display = "none";
                this.parentElement.attributesDisplayed = false;
                this.title = "Click to show attributes.";


            }
            else {
                this.parentElement.lastChild.style.display = "block";
                this.parentElement.attributesDisplayed = true;
                this.title = "Click to hide attributes.";


            }

        }

        // setText and getText mitigate differences in how browsers set or get text content.
        function setText(node, text) {
            if (typeof (node.innerText) != "undefined") {
                node.innerText = text;
            }
            else {
                node.textContent = text;
            }

        }

        function getText(node) {
            if (typeof (node.innerText) != "undefined") {
                return node.innerText;
            }
            else {
                return node.textContent;
            }
        }

    </script>
</head>
<body style="font-family: Segoe UI;" onload="startSample()">
    <!--<h1>
        Metadata Demonstration Sample
    </h1>
    <p>
        This form requires JavaScript and will update the page dynamically.
    </p>-->
    <p>
        <!--<input id="dispalert" name="dispalert" type="checkbox" value="alert" /><label for="dispalert">Display alert window when data changes.</label> <br>-->
        Place Holder: <input type="text" name="PlaceHolder" id="placeholder"> <br />
        Entity : <select id="entityselect" name="Entities" onchange ="retrieveAttributes()"></select>
        Field : <select id="attributeselect" name="Attributes"></select>
    </p>
    <p>
        <label id="lblstartSample" for="btnstartSample">
        </label>
        <input type="button" id="btnstartSample" name="btnstartSample" value="Submit" onclick="btnSubmitValues()" />
        <!--<input type="button" id="btnstartSample" name="btnstartSample" value="Submit" onclick="startSample()" />-->
    </p>
    <div id="message">
    </div>
    <ul id="results"></ul>
</body>
</html>
<!--</snippetMetaDataDemo>-->


then you will see the page:




Tuesday, 23 September 2014

download file form notes in crm 2013 using c # code.


aspx page :

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="download.aspx.cs" Inherits="pdfdownload.download" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
        <asp:Label ID="Namelabel" runat="server" Text="Name"></asp:Label>
&nbsp;&nbsp;
        <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
&nbsp;&nbsp;
        <asp:HyperLink ID="hyperdownload" runat="server">Download</asp:HyperLink>
   
        <asp:Button ID="btndownload" runat="server" OnClick="btndownload_Click" Text="Download" />
   
    </div>
    </form>
</body>
</html>


C# code :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Xrm.Sdk;
//using pdfdownload.ServiceReference1;
using Xrm;
using Microsoft.Xrm.Sdk.Client;
using System.Net;
using System.ServiceModel.Description;
//using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;
using System.Text;
using System.IO;
//using Microsoft.Crm.Sdk.Samples;
namespace pdfdownload
{
    public partial class download : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {


        }

        protected void btndownload_Click(object sender, EventArgs e)
        {
            ClientCredentials Credentials = new ClientCredentials();
            Credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
            //This URL needs to be updated to match the servername and Organization for the environment.
            Uri OrganizationUri = new Uri("http://win-qctbmlihah0:5555/CRM2013Vanilla/XRMServices/2011/Organization.svc");
            Uri HomeRealmUri = null;

            //OrganizationServiceProxy serviceProxy;       
            using (OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(OrganizationUri, HomeRealmUri, Credentials, null))
            {
                serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
                IOrganizationService service = (IOrganizationService)serviceProxy;

                //Instantiate the contact object and populate the attributes.      
                string annotationID = "A9FE2781-FB3F-E411-971A-0800274C12EC";
              //  byte[] fileData = DownloadAttachment(annotationID);

                string firstname = txtName.Text;
                byte[] fileData = DownloadAttachment(firstname);
               
            }
        }
        public  byte[] DownloadAttachment(string AnnotationId)
        {
              byte[] newFile1 = new byte[10];
            ClientCredentials Credentials = new ClientCredentials();
            Credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
            //This URL needs to be updated to match the servername and Organization for the environment.
            Uri OrganizationUri = new Uri("http://win-qctbmlihah0:5555/CRM2013Vanilla/XRMServices/2011/Organization.svc");
            Uri HomeRealmUri = null;
            Guid ObjectreferenceID = new Guid();
            string referencenumber = AnnotationId;
            //OrganizationServiceProxy serviceProxy;       
            using (OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(OrganizationUri, HomeRealmUri, Credentials, null))
            {
                serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
                IOrganizationService service = (IOrganizationService)serviceProxy;


                ConditionExpression condition = new ConditionExpression();
                condition.AttributeName = "firstname";
                condition.Operator = ConditionOperator.Equal;
                condition.Values.Add(referencenumber);

                FilterExpression filter1 = new FilterExpression();
                filter1.Conditions.Add(condition);


                QueryExpression query = new QueryExpression("contact");

                query.ColumnSet.AddColumns("firstname",  "lastname","contactid");

                query.Criteria.AddFilter(filter1);

                EntityCollection result1 = serviceProxy.RetrieveMultiple(query);

                foreach (Entity entities in result1.Entities)
                {
                    //EntityReference var1 = (EntityReference)entities.Attributes["contactid"];
                    ObjectreferenceID = entities.Id;
                    
                }


                ConditionExpression AnnotationCondition = new ConditionExpression();
                AnnotationCondition.AttributeName = "objectid";
                AnnotationCondition.Operator = ConditionOperator.Equal;
                AnnotationCondition.Values.Add(ObjectreferenceID);

                FilterExpression AnnotationFilter = new FilterExpression();
                AnnotationFilter.Conditions.Add(AnnotationCondition);


                QueryExpression AnotationQuery = new QueryExpression("annotation");

                AnotationQuery.ColumnSet.AddColumns("filename", "documentbody", "annotationid");

                AnotationQuery.Criteria.AddFilter(AnnotationFilter);

                EntityCollection AnnotationResult = serviceProxy.RetrieveMultiple(AnotationQuery);

                Guid annotationId = new Guid();
              
                foreach (Entity entities in AnnotationResult.Entities)
                {
                    string filename = entities["filename"].ToString();
                    annotationId = entities.Id;

                    using (FileStream fileStream = new FileStream(filename, FileMode.OpenOrCreate))
                    {

                        byte[] newFile = Convert.FromBase64String(entities["documentbody"].ToString());
                        //EntityReference var1 = (EntityReference)entities.Attributes["annotationId"];
                        string nameoffile = filename;
                        // fileStream fs = fileStream.Read(newFile, 0, newFile.Length);
                        fileStream.Write(newFile, 0, newFile.Length);
                        fileStream.Read(newFile, 0, newFile.Length);
                        Response.ClearContent();
                        Response.Clear();
                        Response.BinaryWrite(newFile);
                        Response.AddHeader("Content-Disposition", "attachment; filename=" + nameoffile);
                        Response.End();


                        return newFile;

                    }

                }


                return newFile1;
            }
        }
    }
}

in this we will see the byte coversion also.

Thursday, 21 November 2013

Obrivations


here is the obrivations:

Web Services Description Language (WSDL)
Windows Communication Foundation (WCF)
Customer Relationship Management (CRM)
Uniform Resource Identifier (URI).
REST represents Representational State Transfer.
SOAP stands for Simple Object Access Protocol

getting the selected radgrid values in c#



DataKeyNames="accumulatorname"

getting the selected radgrid values in c#

first we need to set the properities:


     
                                                            <telerik:RadGrid ID="radGridPromotionStatus" runat="server" class="inputfields"
                                                                GridLines="None" AutoGenerateColumns="False" CssClass="Grid" width="800"
                                                                 meta:resourcekey="radGridResource1"
                                                                CellSpacing="0" OnSelectedIndexChanged="Page_PreRender" DataKeyNames="column11" >
                                                                <ClientSettings AllowColumnsReorder="False" EnablePostBackOnRowClick="true"  >
                                                                   <Selecting AllowRowSelect="true"  />
                                                                    <%--<ClientEvents runat="server" OnRowSelected="Page_PreRender" />--%>
                                                                    <Resizing AllowColumnResize="True" />
                                                                </ClientSettings>
                                                                <MasterTableView NoDetailRecordsText="&nbsp;" DataKeyNames="accumulatorname" >

    <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>

    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
                                                                     <Columns>
                                                                        <telerik:GridBoundColumn DataField="accumulatorname" HeaderText="Accumulator Name"
                                                                            UniqueName="column11" meta:resourcekey="GridBoundColumnResource11" HeaderStyle-Width="125px">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn DataField="accumulationamount" HeaderText="Accumulation Amount"
                                                                            UniqueName="column12" meta:resourcekey="GridBoundColumnResource12" HeaderStyle-Width="125px">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn DataField="nextthresholdnumber" HeaderText="NextThreshold Number"
                                                                            UniqueName="column13" meta:resourcekey="GridBoundColumnResource13" HeaderStyle-Width="150px">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn DataField="nextthresholdid" HeaderText="NextThreshold ID"
                                                                            UniqueName="column14" meta:resourcekey="GridBoundColumnResource14" HeaderStyle-Width="125px">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn DataField="reachedthresholdnumber" HeaderText="Reachedthreshold Number"
                                                                            UniqueName="column15" meta:resourcekey="GridBoundColumnResource14" HeaderStyle-Width="150px">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn DataField="reachedthresholdid" HeaderText="Reachedthreshold ID"
                                                                            UniqueName="column16" meta:resourcekey="GridBoundColumnResource14" HeaderStyle-Width="125px" >
                                                                        </telerik:GridBoundColumn>
                                                                    </Columns>
                                                                    <NoRecordsTemplate>
                                                                        <div style="text-align: center; padding-top: 50px; height: 100px; font-size: 12pt;">
<asp:Label ID="lblNoRecords"  meta:resourcekey="lblNoRecordsResource1" runat="server" Text="There are no records to display"></asp:Label>
</div>
                                                                    </NoRecordsTemplate>

    <EditFormSettings>
    <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
    </EditFormSettings>
                                                                </MasterTableView>
                                                                <FooterStyle CssClass="GridFooter"></FooterStyle>
                                                                <HeaderStyle CssClass="GridHeader"></HeaderStyle>
                                                                <ItemStyle CssClass="GridRow"></ItemStyle>

    <FilterMenu EnableImageSprites="False"></FilterMenu>

    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
                                                            </telerik:RadGrid>

in coding:
 protected void Page_PreRender(object sender, EventArgs e)
        {
           // string selectedItemname = string.Empty;// ;
            object SelectedValue=null;
            if (radGridPromotionStatus.SelectedItems.Count > 0)
            {
                SelectedValue = radGridPromotionStatus.SelectedValue;
                //var name = radGridPromotionStatus.SelectedValues["column11"].ToString();

                //foreach (GridDataItem item in radGridPromotionStatus.SelectedItems)
                //{
                //    selectedItemname = item["column11"].Text;

                //}

            }

            if (SelectedValue != null)
            {
                divcontext.Visible = true;
            }

            //if (selectedItemname != "")
            //{
            //   // divcontext.Visible = true;
            //}
            else
            {
            }
        }