Friday, 11 August 2017

Set property of type Money in Microsoft CRM 2011


How to correctly change and set property of type Money in Microsoft CRM 2011


Yesterday I found out that setting property of type Money on entity can make really difference.
I’m altering Account records via WCF service one at a time and saving the changes in CRM 2011. I was changing some money property like this :
entity.SomeMoneyProperty = new Money() { Value = decimalValue };
Everything compiled and worked fine until I realized, that the value I was setting really isn’t stored in the CRM. But there was no runtime error, nothing.
So I searched the CRM 2011 SDK and found out, that they use only this type of creating the Money property :
entity.SomeMoneyProperty = new Money(decimalValue);

Dynamics 365 Online regions

  • As of 15 May 2017, here is a list of the current Dynamics 365 Online regions:
  •  
  •  
  •  North America (crm.dynamics.com)
  • South America (crm2.dynamics.com)
  • Canada (crm3.dynamics.com)
  • EMEA (crm4.dynamics.com)
  • APAC (crm5.dynamics.com)
  • Australia (crm6.dynamics.com)
  • Japan (crm7.dynamics.com)
  • India (crm8.dynamics.com)
  • North America 2-for Government (crm9.dynamics.com)
  • United Kingdom (crm11.dynamics.com)
  • Microsoft Cloud Germany (crm.microsoftdynamics.de)

Tuesday, 16 May 2017

Update Optionset, lookup data using OData service, JSON


Here we are going to update Optionset and Lookup fields using Odata Service in CRM 2011. In the SDK sample you will find only to update Text fields. After spending some time on Odata service, i got the solution to update Option set and Lookup fields.

        Here i am going to update Account information using Odata service.
function updateOptionset() {
    // Gets the record Guid
    var id = Xrm.Page.data.entity.getId();    
    var changes = {
      // Text field
        Telephone1: "123456789", 
     // Option set field    
       Address1_AddressTypeCode: {  Value: 3 },
      // Lookup field
       ParentAccountId: {         
           Id: "8F8338A9-9AB2-E011-9E6D-000C29B0167C", // Guid of the parent account
           LogicalName: "account"
       }
    };
  
    //updateRecord exists in JQueryRESTDataOperationFunctions.js
    updateRecord(id, changes, "AccountSet", updateAccountCompleted, null);
}

function updateRecord(id, entityObject, odataSetName, successCallback, errorCallback) {
    var context = Xrm.Page.context;
    var serverUrl = context.getServerUrl();

    //The XRM OData end-point
    var ODATA_ENDPOINT = "/XRMServices/2011/OrganizationData.svc";

    //id is required
    if (!id) {
        alert("record id is required.");
        return;
    }
    //odataSetName is required, i.e. "AccountSet"
    if (!odataSetName) {
        alert("odataSetName is required.");
        return;
    }

    //Parse the entity object into JSON
    var jsonEntity = window.JSON.stringify(entityObject);

    //Asynchronous AJAX function to Update a CRM record using OData
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        datatype: "json",
        data: jsonEntity,
        url: serverUrl + ODATA_ENDPOINT + "/" + odataSetName + "(guid'" + id + "')",
        beforeSend: function (XMLHttpRequest) {
            //Specifying this header ensures that the results will be returned as JSON.             
            XMLHttpRequest.setRequestHeader("Accept", "application/json");

            //Specify the HTTP method MERGE to update just the changes you are submitting.             
            XMLHttpRequest.setRequestHeader("X-HTTP-Method", "MERGE");
        },
        success: function (data, textStatus, XmlHttpRequest) {
            //The MERGE does not return any data at all, so we'll add the id 
            //onto the data object so it can be leveraged in a Callback. When data 
            //is used in the callback function, the field will be named generically, "id"
            data = new Object();
            data.id = id;
            if (successCallback) {
                successCallback(data, textStatus, XmlHttpRequest);
            }
        },
        error: function (XmlHttpRequest, textStatus, errorThrown) {
            if (errorCallback)
                errorCallback(XmlHttpRequest, textStatus, errorThrown);
            else
                errorHandler(XmlHttpRequest, textStatus, errorThrown);
        }
    });
}


function errorHandler(xmlHttpRequest, textStatus, errorThrow) {  
    alert("Error : " + textStatus + ": " + xmlHttpRequest.statusText);
}

//Called upon successful Account update.
function updateAccountCompleted(data, textStatus, XmlHttpRequest) {   
    //Get back the Account JSON object
    var account = data;
    alert("Account updated: id = " + account.id);
}

Hope it helps!!!!

Email Configuration in Dynamic CRM 2016 or 2015

For GMAIL  :



Perform the following Steps to enable the following Gmail settings to work with CRM:

Server Type: Other (POP3/SMPT)
Incoming Server Location: pop.gmail.com
Outgoing Server Location: smtp.gmail.com
Authenticate Using: Credentials Specified by a User or Queue
Use same settings for Outgoing: No (currently, but have used Yes and "Credentials Specified by a User or Queue" also)

Incoming Port: 995
Outgoing Port: 587


Other things to be noted :


1.- Enable POP/Imap ports in GMAIL (configuration/settings Forwarding and POP/IMAP)
2.- Security Checkup: Accounts and Import - Other Google Account settings
3.- Disable less secure apps www.google.com/.../lesssecureapps

Monday, 15 May 2017

CRM 2015 or 2016 Retrieve Plugin code

public void Execute(IServiceProvider serviceProvider)
{
    // Obtain the execution context from the service provider.
    Microsoft.Xrm.Sdk.IPluginExecutionContext context = (Microsoft.Xrm.Sdk.IPluginExecutionContext)
        serviceProvider.GetService(typeof(Microsoft.Xrm.Sdk.IPluginExecutionContext));

    if (context.Depth == 1)
    {
        IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
        IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);

        // Obtain the target entity from the input parmameters.
        EntityReference entity = (EntityReference)context.InputParameters["Target"];

        ColumnSet cols = new ColumnSet(
                             new String[] { "lastname", "firstname", "address1_name" });

        var contact = service.Retrieve("contact", entity.Id, cols);

        if (contact != null)
        {
            if (contact.Attributes.Contains("address1_name") == false)
            {
                contact.Attributes.Add("address1_name", "a default first time value: " );
            }
            else
            {
                contact["address1_name"] = "a value already exist";
            }
            service.Update(contact);
        }
    }
}
 
message : retrieve
mode : synchronous 
pipeline stage :post operation 

Thursday, 11 May 2017

Managed And Unmanaged Solutions in Dynamic crm

Microsoft Dynamic CRM supports two types of solutions:
  • Managed solution
  • Unmanaged solution.
Managed Solution:
A managed solution is a completed solution in which the solution is prevented from being modified in the environment to which it is imported. A managed solution is intended to be distributed and installed.
• Possible to set granular levels of rights to alter elements of the solution such as create views, change field properties, add fields etc.
• Solution cannot be exported.
• Easier administration with new versions. Any changes including field removal will be rendered
• If the solution is removed all the customizations pertaining to that solution will be removed and there will be a Risk of data loss.
Once the managed solution is imported following steps takes place:
  • User cannot add or remove the components in a managed solution.
  • User cannot Export a managed solution.
  • By deleting the managed solution all the components in the solutions will also be uninstalled.
  • Managed solution can be overridden by another new version of managed solution.
Unmanaged Solution:
Unmanaged solution allows the solution to be modified after it is imported. Unmanaged solution is still under development stage and it is not intended to be distributed or installed.
  • All the elements or components in the solution can be customized without any restriction.
  • An unmanaged solution can be exported.
  • When the unmanaged solution is completed and ready to distribute it, export it and package it as a managed solution.
· Unmanaged solution files can be transported from one environment to the other.
  • Entities, Fields, web resources can be removed manually.
The solution acts as a container for the components. If user deletes the solution the components still exist in the default solution.
When a solution is unmanaged, the following steps can takes places:
  • Components can be added and removed.
  • Components can be deleted that allow for deletion.
  • Can Export and Import the unmanaged solution.
  • Unmanaged Solution can be exported as a managed solution once the changes are done.

Monday, 17 April 2017

Installing Portal In Dynamic CRM 2016

STEP BY STEP installation of portal in Dynamic CRM online 2016




STEP 1> Click on the admin





STEP 2>Go to admin center and click on Dynamic 365



 STEP 3> click on portal add-on > manage



 STEP 4> Give a name and choose your desired portal. and click submit.



NOTE : it takes some time for configuring the portal .you can recheck and use it after a few min.

Sunday, 16 April 2017

Dynamics CRM Online vs On-Premise

Most of the people find it difficult to find a clear cut difference between online and on-Premises. so here is your answer. 
i hope CRM guys will find it useful.
CRM OnlineCRM On-premise
This is a cloud-based solution provided by Microsoft in which all the servers and databases are managed by Microsoft.This is an on premise solution provided by Microsoft in which the servers and databases are managed by the customer.
You can get started with an online offering in a matter of few days. You pay for the users and used space on the go.Setting up an on-premise offering needs technical skills as well as sufficient time to setup the CRM instance and get it running.
It supports relatively less customizations and extensions.It supports relatively more customization and extensions.
CRM Online does not give the ability to perform manual data backup and restore options since the database is hosted on Microsoft servers. However, Microsoft performs daily backups of the database.CRM on premise gives the full ability to manage your database.
CRM Online has various plans based on the data storage limits like 5GB, 20 GB, etc.CRM on premise does not have any such limits on storage size since the data exists on your own servers.
CRM Online provides inbuilt capabilities of features such as Insights, Social Listening, Analytics, etc.CRM on premise has extra costs for these features.
CRM Online supports automatic updates to future version.CRM on premise updates need to be installed by the administrator.

Thursday, 13 April 2017

Introduction to Dynamic crm

 

Introduction

Microsoft Dynamics CRM is a customer relationship management software package developed by Microsoft focusing on enhancing customer relationships for any organization. Out of the box, the product focuses mainly on Sales, Marketing, and Customer Service sectors, but Microsoft has been marketing Dynamics CRM as an XRM platform and has been encouraging partners to use its proprietary (.NET based) framework to customize it. In recent years, it has also grown as an Analytics platform driven by CRM.
The CRM Solution can be used to drive the sales productivity and marketing effectiveness for an organization, handle the complete customer support chain, and provide social insights, business intelligence, and a lot of other out-of-the-box functionalities and features. As a product, Microsoft Dynamics CRM also offers full mobile support for using CRM apps on mobiles and tablets.

Prerequisites

Microsoft Dynamics CRM is a product that runs completely on the Microsoft technology stack (ASP.NET, IIS, Microsoft Office, etc.). Hence, basic knowledge of ASP.NET and C# (or VB.NET) is needed.

Product Versions

Microsoft Dynamics CRM has grown over the years starting from its 1.0 version in 2003. The latest version (as of writing this article) is 2015. Following is the chronological list of release versions.
  • Microsoft CRM 1.0     
  • Microsoft CRM 1.2
  • Microsoft Dynamics CRM 3.0
  • Microsoft Dynamics CRM 4.0
  • Microsoft Dynamics CRM 2011
  • Microsoft Dynamics CRM 2013
  • Microsoft Dynamics CRM 2015
  • Microsoft Dynamics CRM 2016

 

 

 

 

 

 

To learn more :  












Power Apps Drag & Drop Kanban code sample

  Introduction: The Kanban Board App Developers at a software company use the Kanban board to show their progress on development tasks and b...