MS Dynamic crm region list

MS Dynamic crm region list method

private string GetRegion(string region)
if (String.IsNullOrEmpty(region))
return string.Empty;

RegionList.Add("1", "North America");
RegionList.Add("2", "South America");
RegionList.Add("3", "Canada");
RegionList.Add("4", "EMEA");
RegionList.Add("5", "APAC");
RegionList.Add("6", "Australia");
RegionList.Add("7", "Japan");
RegionList.Add("8", "India");
RegionList.Add("9", "North America");

return RegionList[region];



#c-sharp, #crm-region-list, #dynamics-crm, #region

MS Dynamics Crm 2016 connection and retrive multiple data

This feature came to ms dynamics crm 2016 SDK and using to Microsoft.Xrm.Tooling.Connector.dll

static void Main(string[] args)
    IOrganizationService service;
    CrmServiceClient crmSvc = null;

    crmSvc = new CrmServiceClient(new System.Net.NetworkCredential("username", "password", "domain"), AuthenticationType.AD, "organizationurl", "443", "organizationname", useUniqueInstance: false, useSsl: true);

    service = crmSvc.OrganizationServiceProxy;

    QueryExpression qe = new QueryExpression();
    qe.ColumnSet = new ColumnSet(true);
    qe.EntityName = "account";
    qe.Criteria = new FilterExpression();
    qe.Criteria.AddCondition(new ConditionExpression("name", ConditionOperator.Equal, "huseyin"));

    var list = service.RetrieveMultiple(qe);



#c, #console, #crm, #dynamics-crm, #dynamics-crm-2016, #retrieve-multiple-data-2016

Random code generated

This code generated a random string code

public static class GenerateCode
        private static string source = "ABCDEFGHIJKLMNOPRSTUVYZabcdefghijklmnoprstyvyz1234567890";
        private static Random random = new Random();

        public static string Generate(int size)
            string generatedCode = new string(
            Enumerable.Repeat(source, size)
            .Select(s => s[random.Next(s.Length)])

            return generatedCode;

#csharp, #generate-code, #random, #random-code