ms crm 2013 Archives - Microsoft Dynamics 365 Blog https://microsoftdynamics.in/category/ms-crm-2013/ Microsoft Dynamics CRM . Microsoft Power Platform Mon, 18 Dec 2017 10:29:00 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/cropped-Microsoftdynamics365-blogs.png?fit=32%2C32&ssl=1 ms crm 2013 Archives - Microsoft Dynamics 365 Blog https://microsoftdynamics.in/category/ms-crm-2013/ 32 32 176351444 How to Create Dynamic OptionSet in MS Dynamics CRM 2011 & 2013 dynamics365 https://microsoftdynamics.in/2017/12/18/how-to-create-dynamic-optionset-in-ms-dynamics-crm-2011-2013-dynamics365/ Mon, 18 Dec 2017 10:29:00 +0000 http://microsoftdynamics.in/2017/12/18/how-to-create-dynamic-optionset-in-ms-dynamics-crm-2011-2013-dynamics365/ How to Create Dynamic OptionSet in MS Dynamics CRM 2011 & 2013 This code will help you……………… function dynamicoptionset() { //get value in no in variable     var totaldivision = Xrm.Page.getAttribute(“fieldname” ).getValue();     if (totaldivision == null || totaldivision == “” )         return;     else {         var optionsetControl = Xrm.Page.ui.controls.get( “new_division” );         var options = optionsetControl.getAttribute().getOptions();         optionsetControl.clearOptions();         for ( var i = 0; i < totaldivision; i++) {             optionsetControl.addOption(options[i]);         }    ...

The post How to Create Dynamic OptionSet in MS Dynamics CRM 2011 & 2013 dynamics365 appeared first on Microsoft Dynamics 365 Blog.

]]>
How to Create Dynamic OptionSet in MS Dynamics CRM 2011 & 2013

This code will help you………………
function dynamicoptionset() {

//get value in no in variable
    var totaldivision = Xrm.Page.getAttribute(“fieldname” ).getValue();
    if (totaldivision == null || totaldivision == “” )
        return;
    else {
        var optionsetControl = Xrm.Page.ui.controls.get( “new_division” );
        var options = optionsetControl.getAttribute().getOptions();

        optionsetControl.clearOptions();
        for ( var i = 0; i < totaldivision; i++) {

            optionsetControl.addOption(options[i]);
        }
    }
}


SOURCE : mscrm.com

The post How to Create Dynamic OptionSet in MS Dynamics CRM 2011 & 2013 dynamics365 appeared first on Microsoft Dynamics 365 Blog.

]]>
2771
Get Server URL or IP using JavaScript in MSCRM 2011 , MSCRM 2013 , MSCRM 2015 https://microsoftdynamics.in/2015/06/10/get-server-url-or-ip-using-javascript-in-mscrm-2011-mscrm-2013-mscrm-2015/ Wed, 10 Jun 2015 12:55:00 +0000 http://microsoftdynamics.in/2015/06/10/get-server-url-or-ip-using-javascript-in-mscrm-2011-mscrm-2013-mscrm-2015/ Some time we need to get server IP  instead of Server URL Like when we need to write Odata Query in dev and frequently sift Solution from dev to production , it imp to get Ip dynamically so , you Odata don’t give error . // Simple Server Url using JavaScript var serverUrl = Xrm.Page.context.getServerUrl();...

The post Get Server URL or IP using JavaScript in MSCRM 2011 , MSCRM 2013 , MSCRM 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
Some time we need to get server IP  instead of Server URL Like when we need to write Odata Query in dev and frequently sift Solution from dev to production , it imp to get Ip dynamically so , you Odata don’t give error .
// Simple Server Url using JavaScript
var serverUrl = Xrm.Page.context.getServerUrl();
//Work fine for both IP And server

var serverUrl = document.location.protocol + “//” + document.location.host + “/” + Xrm.Page.context.getOrgUniqueName();

This Above code will work fine for both Server IP or Url as when we access mscrm record with only server name ( but our odata code contain ip it will throw an exception ) or if we access with IP ans our code contain server url so to prevent this we can use above code to get dynamic URL address.

SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Get Server URL or IP using JavaScript in MSCRM 2011 , MSCRM 2013 , MSCRM 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
2797
Activate / Deactivate a record using c# in MS CRM 2011 , MS CRM 2013 , MS CRM 2015 ( using SetStateRequest ) https://microsoftdynamics.in/2015/02/25/activate-deactivate-a-record-using-c-in-ms-crm-2011-ms-crm-2013-ms-crm-2015-using-setstaterequest/ Wed, 25 Feb 2015 12:29:00 +0000 http://microsoftdynamics.in/2015/02/25/activate-deactivate-a-record-using-c-in-ms-crm-2011-ms-crm-2013-ms-crm-2015-using-setstaterequest/ hey , as we offensively get requirement to activate and reactivate a record then we start using update event , but there is a very simple method to do so , by using SetStateRequest : it require an assembly ” microsoft.crm.sdk.proxy.dll ” and using ” using Microsoft.Crm.Sdk.Messages;” . Code will be : SetStateRequest req = new SetStateRequest(); //the...

The post Activate / Deactivate a record using c# in MS CRM 2011 , MS CRM 2013 , MS CRM 2015 ( using SetStateRequest ) appeared first on Microsoft Dynamics 365 Blog.

]]>

hey , as we offensively get requirement to activate and reactivate a record then we start using update event , but there is a very simple method to do so , by using SetStateRequest : it require an assembly ” microsoft.crm.sdk.proxy.dll ” and using ” using Microsoft.Crm.Sdk.Messages;” .
Code will be :
   SetStateRequest req = new SetStateRequest();
//the entity you want to change the state of
req.EntityMoniker = new EntityReference("new_abc", recordId);
//what should the new state be
req.State = new OptionSetValue(1);
//Pick an option from the status reason picklist to specify reason for state change
req.Status = new OptionSetValue(2);
SetStateResponse resp = (SetStateResponse)service.Execute(req);

SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Activate / Deactivate a record using c# in MS CRM 2011 , MS CRM 2013 , MS CRM 2015 ( using SetStateRequest ) appeared first on Microsoft Dynamics 365 Blog.

]]>
2799
Fields that are not valid were specified for the entity – Importing Solution Error mscrm 2011 , mscrm 2013 , mscrm 2015 https://microsoftdynamics.in/2015/02/25/fields-that-are-not-valid-were-specified-for-the-entity-importing-solution-error-mscrm-2011-mscrm-2013-mscrm-2015/ Wed, 25 Feb 2015 12:12:00 +0000 http://microsoftdynamics.in/2015/02/25/fields-that-are-not-valid-were-specified-for-the-entity-importing-solution-error-mscrm-2011-mscrm-2013-mscrm-2015/ Hey , I was importing a solution today from an other Organization and got a Error new to me :  Fields that are not valid were specified for the entity , as there was no description i was little confused , but after few R&D came up with perfect resolution of the error . Reason ...

The post Fields that are not valid were specified for the entity – Importing Solution Error mscrm 2011 , mscrm 2013 , mscrm 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
Hey , I was importing a solution today from an other Organization and got a Error new to me :  Fields that are not valid were specified for the entity , as there was no description i was little confused , but after few R&D came up with perfect resolution of the error .

Reason 

  • Organization “A” conatined attribute ‘new_mscrm’ that was of type “single line” ,Later  We changed that the field  to be an currency Type.
  • But in Organization “B” was containg same field ‘new_mscrm’ of type “Single line”.
  • When we tried to import back the new solution to test environment we got this Import failure message as the solution we were importing was having a field ‘new_mscrm’ of type Currency

Solution

  • Just delete the field in the Organization in which you are importing the solution and reimport the same solution to it
Hope this helped you Thanks

SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Fields that are not valid were specified for the entity – Importing Solution Error mscrm 2011 , mscrm 2013 , mscrm 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
2800
Set Field Read Only Using JavaScript In MSCRM ( Lock Field in MS CRM ) https://microsoftdynamics.in/2015/02/20/set-field-read-only-using-javascript-in-mscrm-lock-field-in-ms-crm/ Fri, 20 Feb 2015 10:19:00 +0000 http://microsoftdynamics.in/2015/02/20/set-field-read-only-using-javascript-in-mscrm-lock-field-in-ms-crm/ Hey Below is the Code To Set a Attribute / field on form Read only (Lock) using JavaScript in MS CRM . // Get Control of entity Xrm.Page.ui.controls.get(“new_companyreference”); // Now set the property to lock the field ToBeReadOnlyControl.setDisabled(true); Note : Xrm.Page.ui.controls.get(“new_companyreference”); by this we get full UI controls of the attribute / field by which we...

The post Set Field Read Only Using JavaScript In MSCRM ( Lock Field in MS CRM ) appeared first on Microsoft Dynamics 365 Blog.

]]>

Hey Below is the Code To Set a Attribute / field on form Read only (Lock) using JavaScript in MS CRM .
// Get Control of entity
Xrm.Page.ui.controls.get(“new_companyreference”);
// Now set the property to lock the field

ToBeReadOnlyControl.setDisabled(true);
Note : Xrm.Page.ui.controls.get(“new_companyreference”); by this we get full UI controls of the attribute / field by which we can set or get any ui property of that field .

SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Set Field Read Only Using JavaScript In MSCRM ( Lock Field in MS CRM ) appeared first on Microsoft Dynamics 365 Blog.

]]>
2801
Get Entity Name Using JavaScript in ms crm 2011 , ms crm 2013 , ms crm 2015 ( get dynamically Entity Name using Javascript) https://microsoftdynamics.in/2015/02/19/get-entity-name-using-javascript-in-ms-crm-2011-ms-crm-2013-ms-crm-2015-get-dynamically-entity-name-using-javascript/ Thu, 19 Feb 2015 12:51:00 +0000 http://microsoftdynamics.in/2015/02/19/get-entity-name-using-javascript-in-ms-crm-2011-ms-crm-2013-ms-crm-2015-get-dynamically-entity-name-using-javascript/ Below is the Code for Fetching Name of an Entity Using JavaScript In mscrm , Which can be used for many purposes  Like if you want to popup an new entity form ( you can create a generic function ) var entityName = Xrm.Page.data.entity.getEntityName(); // Pop Up example var id = Xrm.Page.data.entity.getId(); var entityName =...

The post Get Entity Name Using JavaScript in ms crm 2011 , ms crm 2013 , ms crm 2015 ( get dynamically Entity Name using Javascript) appeared first on Microsoft Dynamics 365 Blog.

]]>

Below is the Code for Fetching Name of an Entity Using JavaScript In mscrm , Which can be used for many purposes  Like if you want to popup an new entity form ( you can create a generic function )
 var entityName = Xrm.Page.data.entity.getEntityName();
// Pop Up example
 var id = Xrm.Page.data.entity.getId();
var entityName = Xrm.Page.data.entity.getEntityName();
Xrm.Utility.openEntityForm(entityName, id);


Hope This Helps You Thanks.

SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Get Entity Name Using JavaScript in ms crm 2011 , ms crm 2013 , ms crm 2015 ( get dynamically Entity Name using Javascript) appeared first on Microsoft Dynamics 365 Blog.

]]>
2802
Get field Name Using JavaScript in ms crm 2011 , ms crm 2013 , ms crm 2015 ( get dynamically field Label using JavaScript) https://microsoftdynamics.in/2015/02/19/get-field-name-using-javascript-in-ms-crm-2011-ms-crm-2013-ms-crm-2015-get-dynamically-field-label-using-javascript/ Thu, 19 Feb 2015 12:14:00 +0000 http://microsoftdynamics.in/2015/02/19/get-field-name-using-javascript-in-ms-crm-2011-ms-crm-2013-ms-crm-2015-get-dynamically-field-label-using-javascript/ Hi all below you will find how to get field label name using JavaScript . var fieldname = executionContext.getEventSource().getName(); NOTE: Remember to pass context as perimeter while submitting function Name. SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Get field Name Using JavaScript in ms crm 2011 , ms crm 2013 , ms crm 2015 ( get dynamically field Label using JavaScript) appeared first on Microsoft Dynamics 365 Blog.

]]>

Hi all below you will find how to get field label name using JavaScript .
 var fieldname = executionContext.getEventSource().getName();
NOTE: Remember to pass context as perimeter while submitting function Name.


SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Get field Name Using JavaScript in ms crm 2011 , ms crm 2013 , ms crm 2015 ( get dynamically field Label using JavaScript) appeared first on Microsoft Dynamics 365 Blog.

]]>
2803
Share A Record With Read Only Access Using Custom Workflow IN MS CRM 2011 , MS CRM 2013 , MS CRM 2015 https://microsoftdynamics.in/2015/01/05/share-a-record-with-read-only-access-using-custom-workflow-in-ms-crm-2011-ms-crm-2013-ms-crm-2015/ Sun, 04 Jan 2015 20:00:00 +0000 http://microsoftdynamics.in/2015/01/05/share-a-record-with-read-only-access-using-custom-workflow-in-ms-crm-2011-ms-crm-2013-ms-crm-2015/ Share a Record to a user without Assigning the record and with out giving Read access to that user , its a Custom Workflow to share a record with read only access , ( NOTE : You can not give read only access to owner of that record so , first we have to change...

The post Share A Record With Read Only Access Using Custom Workflow IN MS CRM 2011 , MS CRM 2013 , MS CRM 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
Share a Record to a user without Assigning the record and with out giving Read access to that user , its a Custom Workflow to share a record with read only access , ( NOTE : You can not give read only access to owner of that record so , first we have to change the owner and then we can share it to created by user with read only access )


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Portal;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Sdk.Messages;
using Microsoft.Xrm.Sdk.Workflow;
using System.Activities;
using Microsoft.Crm.Sdk.Messages;


namespace Readonlyaccess_sharerecord
{
    public class Class1 : CodeActivity
    {
        #region input parameter
        // In set property : give the user to whom record will be shared
        [ Input( “User_to_Share” )]
        // look up field of system user “Entity Name”
        [ ReferenceTarget (“systemuser” )]
        public InArgument <EntityReference > _User_to_Share { getset; }
        #endregion

        #region Output parameter
        //
        [ Output( “condition” )]
        public OutArgument <string > _condition { getset; }

        #endregion
        protected override void Execute( CodeActivityContext context)
        {

            IWorkflowContext workflowContext = context.GetExtension<IWorkflowContext >();
            IOrganizationServiceFactory serviceFactory = context.GetExtension<IOrganizationServiceFactory >();
            IOrganizationService service = serviceFactory.CreateOrganizationService(workflowContext.UserId);
            #region paramters
            EntityReference User_to_Share = _User_to_Share.Get<EntityReference >(context);

            #endregion
            try
            {
                Entity Obj_entity = (Entity )service.Retrieve(workflowContext.PrimaryEntityName, workflowContext.PrimaryEntityId, newColumnSet (true ));

                try
                {
                    //no delete access
                    GrantAccessRequest grant = new GrantAccessRequest ();
                    grant.Target = new EntityReference (workflowContext.PrimaryEntityName, workflowContext.PrimaryEntityId);

                    PrincipalAccess principal = new PrincipalAccess ();
                    principal.Principal = User_to_Share;
                    principal.AccessMask = AccessRights .ReadAccess;
                    grant.PrincipalAccess = principal;
                    GrantAccessResponse grant_response = (GrantAccessResponse )service.Execute(grant);
                    _condition.Set(context, “1” );

                }
                catch ( Exception ex)
                {
                    _condition.Set(context, “0” );
                    throw new Exception( “Enable to Grant Read Access i.e.” + ex.Message);
                }

            }
            catch ( Exception ex)
            {
                throw new Exception( “Error Due To Master User Share i.e.” + ex.Message);
            }

        }
    }
}

1. Add Step to your Workflow.

2. Set Property and provide the user whom to share the record.

3. Forms become readonly after execution of record

SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Share A Record With Read Only Access Using Custom Workflow IN MS CRM 2011 , MS CRM 2013 , MS CRM 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
2805
Get Current Record Id of an entity using javascript in ms crm 2011 , ms crm 2013 and ms crm 2015 https://microsoftdynamics.in/2015/01/02/get-current-record-id-of-an-entity-using-javascript-in-ms-crm-2011-ms-crm-2013-and-ms-crm-2015/ Fri, 02 Jan 2015 10:56:00 +0000 http://microsoftdynamics.in/2015/01/02/get-current-record-id-of-an-entity-using-javascript-in-ms-crm-2011-ms-crm-2013-and-ms-crm-2015/ Get Record ID of an entity using javascript inn microsoft dynamics CRM . function Recordid() {     debugger;    var recordID = Xrm.Page.data.entity.getId();    var entityName = “new_entityname” ;    var urlcreation = “http://organizationame/main.aspx?etn=” +entityName+ “&pagetype=entityrecord&id=” + recordID + “#127104932” ; } SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Get Current Record Id of an entity using javascript in ms crm 2011 , ms crm 2013 and ms crm 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
Get Record ID of an entity using javascript inn microsoft dynamics CRM .

function Recordid() {
    debugger;
   var recordID = Xrm.Page.data.entity.getId();
   var entityName = “new_entityname” ;
   var urlcreation = “http://organizationame/main.aspx?
etn=” +entityName+ “&pagetype=entityrecord&id=” + recordID + “#127104932” ;
}

SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Get Current Record Id of an entity using javascript in ms crm 2011 , ms crm 2013 and ms crm 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
2806
Get Form Name of an Entity using JavaScript in MS CRM 2011 , MS CRM 2013 , MS CRM 2015 https://microsoftdynamics.in/2015/01/02/get-form-name-of-an-entity-using-javascript-in-ms-crm-2011-ms-crm-2013-ms-crm-2015/ https://microsoftdynamics.in/2015/01/02/get-form-name-of-an-entity-using-javascript-in-ms-crm-2011-ms-crm-2013-ms-crm-2015/#comments Fri, 02 Jan 2015 10:45:00 +0000 http://microsoftdynamics.in/2015/01/02/get-form-name-of-an-entity-using-javascript-in-ms-crm-2011-ms-crm-2013-ms-crm-2015/ Get Form name of an entity using javascript in microsoft dynamics crm ,This help in getting saved record form name from multipal forms ( if you want to show it in reports etc). function formname() {     debugger;     var name = Xrm.Page.ui.formSelector.getCurrentItem().getLabel();     alert(name); } SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Get Form Name of an Entity using JavaScript in MS CRM 2011 , MS CRM 2013 , MS CRM 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
Get Form name of an entity using javascript in microsoft dynamics crm ,This help in getting saved record form name from multipal forms ( if you want to show it in reports etc).

function formname() {
    debugger;
    var name = Xrm.Page.ui.formSelector.getCurrentItem().getLabel();

    alert(name);
}



SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Get Form Name of an Entity using JavaScript in MS CRM 2011 , MS CRM 2013 , MS CRM 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
https://microsoftdynamics.in/2015/01/02/get-form-name-of-an-entity-using-javascript-in-ms-crm-2011-ms-crm-2013-ms-crm-2015/feed/ 2 2807