CRM 2011 etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
CRM 2011 etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

10 Aralık 2015 Perşembe

CRM 2011 - Gelişmiş Bul 'da Her Sayfada Görünecek Kayıt Sayısını Değiştirme (Change the number of records per page in any list of records)

Aşağıdaki yazımda Gelişmiş Bul ;'da yapılan sorgulamada her sayfa için 50 adet kayıt listeleniyordu. Ben bunu her sayfada 250 kayıt gelecek şekilde değiştireceğim.

CRM ana ekranında File butonuna tıklayalım. Gelen seçeneklerden Options a tıklayalım.

Set Personal Options penceresinde General tabının altından Set the number of records per page in any list of records  kısmından her sayfada kaç adet kayıt geleceğini seçelim.Ok butonuna basalım.
 50 olan seçeneği 250 olarak değiştirelim..
 Seçeneğimi 250 olarak değiştirdikten sonra Ok butonuna basalım.
 Gelişmiş Bul 'u açalım ve ekranda 250 kayıt görelim.

CRM 2011 - Kullanıcı TimeZone Ayarları (CurrentUser Timezone Settings)

CRM ana ekranında File butonuna tıklayalım. Gelen seçeneklerden Options a tıklayalım.

Set Personal Options penceresinde General tabının altından Set the time zone you are in  kısmından Time Zone u seçelim.Ok butonuna basalım.




9 Aralık 2015 Çarşamba

CRM 2011 - Retrive Kullanımı (Get Opportunity)

IOrganizationService içerisindeki Retrieve metodu ile guid si bilinen değerlere kısa yoldan ulaşabilirsiniz.

 Opportunity opportunity = (Opportunity)crmService.Retrieve("opportunity", opportunityId, new ColumnSet("opportunityid", "pricelevelid", "name"));
                 

CRM 2011 - Is Guid (REGEX)

   public static bool IsGuid(this string s)
        {
            if (s == null)
                throw new ArgumentNullException("s");

            Regex format = new Regex(
                "^[A-Fa-f0-9]{32}$|" +
                "^({|\\()?[A-Fa-f0-9]{8}-([A-Fa-f0-9]{4}-){3}[A-Fa-f0-9]{12}(}|\\))?$|" +
                "^({)?[0xA-Fa-f0-9]{3,10}(, {0,1}[0xA-Fa-f0-9]{3,6}){2}, {0,1}({)([0xA-Fa-f0-9]{3,4}, {0,1}){7}[0xA-Fa-f0-9]{3,4}(}})$");
            Match match = format.Match(s);

            return match.Success;
        }

Extension Kullanımı

 if (!string.IsNullOrEmpty(entityid) && entityid.IsGuid())
{

}

CRM 2011 - İki Varlık Arasında İlişki lup Olmadığını Bulma (RelationshipExists)

private static bool RelationshipExists(IOrganizationService service, string relationshipname, Guid entity1Id, string entity1Name, Guid entity2Id, string entity2Name)
        {
            try
            {
                string relationship1EtityName = string.Format("{0}id", entity1Name);
                string relationship2EntityName = string.Format("{0}id", entity2Name);

                //This check is added for self-referenced relationships
                if (entity1Name.Equals(entity2Name, StringComparison.InvariantCultureIgnoreCase))
                {
                    relationship1EtityName = string.Format("{0}idone", entity1Name);
                    relationship1EtityName = string.Format("{0}idtwo", entity1Name);
                }

                QueryExpression query = new QueryExpression(entity1Name)
                {
                    ColumnSet = new ColumnSet(false)
                };

                LinkEntity link = query.AddLink(relationshipname,string.Format("{0}id", entity1Name), relationship1EtityName);
                link.LinkCriteria.AddCondition(relationship1EtityName,ConditionOperator.Equal, new object[] { entity1Id });
                link.LinkCriteria.AddCondition(relationship2EntityName,ConditionOperator.Equal, new object[] { entity2Id });

                return service.RetrieveMultiple(query).Entities.Count != 0;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

Metot Kullanımı

bool isRelationshipExists = RelationshipExists(service, relationshipentityname, entityid, entityname, entityreferenceId, entityreferencename);
                if (!isRelationshipExists)
                {

}

CRM 2011 - Atama İşlemi (Assign Team or User)

Assign işlemi kullanıcıya ya da takıma yapılabilir . Bunun için aşağıdaki metoda hangi kayıt ı kime assign edeceğimiz bilgilerini göndermek yeterli olacaktır.

Target : Atama yapılacak varlık
Assignee : Atama yapılacak kullanıcı ya da takım

public static void AssignTeamorUser(IOrganizationService serviceCRM, string assigneeLogicalName, Guid assigneeGuidId, string targetLogicalName, Guid targetGuidId)
        {
            try
            {
                AssignRequest assign = new AssignRequest
                {
                    Assignee = new EntityReference(assigneeLogicalName, assigneeGuidId),
                    Target = new EntityReference(targetLogicalName, targetGuidId)
                };
                serviceCRM.Execute(assign);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

CRM 2011 - CRM Arayüzü Dilini Değiştirme (Change User Interface Language)

CRM ana ekranında File butonuna tıklayalım. Gelen seçeneklerden Options a tıklayalım.

Set Personal Options penceresinde Languages tabının altından User Interface Languages kısmından crm i kulanacağımız dili seçelim.Ok butonuna basalım.


Not : Kullanıcı arayüzü dilini seçecegimiz dili ilk önce CRM e yüklememiz gerekir.

8 Aralık 2015 Salı

CRM 2011 - Excel Export Kayıt Sayısını Arttırma

Crm’de gelişmiş buldan bir sorgu hazırlayarak kayıtları listelediğinizde ya da grid üzerinden tüm kayıtları excele çıkarttığınızda 10.000 satırdan daha fazlasını çıkartmak mümkün değildir.

Bu sayıyı attrımak için regeditte değişiklik yapmamız gerekmektedir.

Regedit’ten aşağıdaki şekilde Dword oluşturmamız gerekmektedir.

HKEY_LOCAL_MACHINE
      SOFTWARE
          Microsoft
             MSCRM

Dword Name  : maxrecordsforexporttoexcel
Decimal Value: 65535

Regedit içerisinde değiştirdiğimizde sayı artmamışsa OrganizationBase tablosundan kontrol etmek gerekir. Burada MaxRecordsForExportToExcel değerini Sql’den değiştirmek gerekir.

Not: Bu veritabanına direk müdahale olduğu için Microsoft tarafından destek verilmez.

7 Aralık 2015 Pazartesi

CRM - Error initializing component with element id=’xxxx’ and with type=’null’: Object doesn’t support this action – CRM

<CrmScriptErrorReport>
<ReportVersion>1.0</ReportVersion>
<ScriptErrorDetails>
<Message>Error initializing component with element id=’xxxx’ and with type=’null’: Object doesn’t support this action</Message>

Yukarıdaki hatanın sebebi Microsoft Dynamics CRM site ının Authentication larında Anonymous Authentication ının Disabled olmasıdır.Bu özelliği IIS ten Enabled yapıp ,IIS'e reset atarak hatayı çözmüş oluruz.



28 Eylül 2015 Pazartesi

CRM 2011 - CRM e Farklı Browserlardan Erişim

Bildiğiniz gibi CRM 2011 RU 12 sonrası IE harici tarayıcılarda da kullanılabiliyor. Ancak CRM IFD yapılandırmasında ADFS Authentication için Extended Protection kullanılıyor. Bu özellik diğer tarayıcılarda tam çalışmadığından maalesef CRM e login olamıyorsunuz ve sürekli olarak kullanıcı adı ve şifre girerek başa dönüyorsunuz.Bunu düzeltmek için aşagıdaki adımları yapmamız gerekmektedir.


  • ADFS kurulu olan sunucuya gidip IIS Manager başlatılır.
  • "Default WebSite" altında "ADFS" onun altında da "LS" yi seçiniz.
  • Sol tarafta "Authentication" altında "Windows" Authentication için "Advanced Settings" e sağ tıklayalım.
  • Extended Protection ı "Accept" durumundan "Off" durumuna getiriniz.
  • Enable Kerner-mode authentication ı seciniz.II i restart ettipğimizde IE harici tarayıcılardan da CRM e girebiliyor olacaksınız.



CRM 2011 - Kullanıcılardan Excel Export Yetkisiini Almak

Bu işlem data güvenliğini sağlamak adına yapılır.


Rol tanımlarından "Business Management" veya "İşletme Yönetimi" tabı altında görebilirsiniz.Bu yetkiyi aldığımız takdirde bu role sahip kullanıcılar CRM üzerindeki ekranlardan excel çıktısı alamaz.

System - Administrator - Security Roles  altından bir rol seçelim ve gerekli işlemlerimizi yapalım.


16 Haziran 2014 Pazartesi

CRM 2011 - 2013 - Eklenen Dosya için Maximum Boyut Tanımlama( Setting the Maximum File Size limits for attachments)

Crm üzerinde not eklerken bazen buyuk boyutlu dosya sectıgınızde hata alacaksınız.
(The attachment is too large)
CRM de dosya boyutu default  5.192 mb olarak gelmektedir.Biz bu sorunu ekleyecegimiz dosya byutundan fazla vererek hatayı gidermiş oluruz.

  1. Go to Settings -> Administration - Ayarlar
  2. Click on System Settings - Sistem Ayarları
  3. Click on E-mail tab -Email 
  4. Go to the bottom, on the section 'Set file size (in kilobytes)' - Ekler için dosya boyutu ekleme
  5. Replace current value with  "8,192" - 8192 (8 mb)









28 Mayıs 2014 Çarşamba

CRM 2011 - ParticipationTypeMask Değerleri

Activity party typeValueDescription
Sender- From
1
Specifies the sender.
ToRecipient - To
2
Specifies the recipient in the To field.
CCRecipient -CC
3
Specifies the recipient in the Cc field.
BccRecipient -BCC
4
Specifies the recipient in the Bcc field.
RequiredAttendee
5
Specifies a required attendee.
OptionalAttendee
6
Specifies an optional attendee.
Organizer
7
Specifies the activity organizer.
Regarding
8
Specifies the regarding item.
Owner
9
Specifies the activity owner.
Resource
10
Specifies a resource.
Customer
11
Specifies a customer.
Partner
12
Specifies a partner.

8 Nisan 2014 Salı

CRM 2011 - Invalid Action - The selected action was not valid.

Kullanıcılar CRM'e erişirken "Invalid Action - The selected action was not valid." ya da türkçe kurulumlarda "Geçersiz Eylem - Seçilen eylem geçerli değil" şekline bir hata ile karşılaşmaktadır.

Bu rounla karşılaştığınızda ilk olarak yapılması gereken CRM Async Service'in çalıştığını teyit etmektir. Ancak bazen bu servis çalışmasına rağmen sorun devam edebilmektedir. Bu durumda loglara baktığımızda aşağıdaki gibi bir hata ile karşılaşırız:


Source: Current active key (KeyType : CrmWRPCTokenKey) is expired. This can indicate that a key is not being regenerated properly. Current Active Key : CrmKey(Id:e1a5b215-d01e-de11-9d16-0003ffd0167c, ScaleGroupId:00000000-0000-0000-0000-000000000000, KeyType:CrmWRPCTokenKey, Expired:True, ValidOn:04/01/2009 15:16:36, ExpiresOn:05/04/2009 15:16:36, CreatedOn:04/01/2009 15:16:36, CreatedBy:NT AUTHORITY\NETWORK SERVICE. Key Setting :



Bu durumda CRM klasöründe tools (C:\Program Files\Microsoft Dynamics CRM\Tools) altında bulunan WRPCKeyRenewal  aracı command line (cmd.exe) üzerinden /R  (Microsoft.Crm.Tools.WRPCKeyRenewal.exe /R) parametresi ile çalıştırılarak sorun çözülebilmektedir.

22 Ocak 2014 Çarşamba

CRM 2011 Error - Principal user is missing prvReadUserQuery privilege


Yeni bir rol actıgınızda ve kullanıcıya sadece bu rolu atadıgınızda kullanıcının CRM e girişlerinde yukarıda belirtilen hatayı verebilir.

Çünkü custom entitiler için view okuma yetkisi verilmemiştir.Yetkiyi verdikten sonra sorun kalkacaktır.




23 Temmuz 2013 Salı

CRM 2011 - Cutom Ribbon Butona Tıklanıldığında Sayfa Açma ( Custom Page Open with Ribbon Button)

Customizations.xml dosyasında Actions tagının altında asagıdakı degısıklıklerı yapabilirsiniz.

 <RibbonDiffXml>  < /RibbonDiffXml> tagları arasında  <CommandDefinitions> tagı altında bulunan butonunnuza ait <CommandDefinition> ında <Actions> tagı içerisinde butonunuza tıklanıldıgında ne yapması gerekecegini belirleyebilirsiniz.

Ya bir javascript dosyası cagırırsınız bunun içersinde birseyler yaparsınız yada direkt url yazarak url deki sayfayı açarsınız.

Eğer sayfa açmak ve açılan sayfaya da query string ile veri göndermek istiyorsanız javascript dosyasını kullanabilirsiniz.

Aşagıda Close as Lost butonuna tıklanıldıgında javascript calıstırmasının ornegını bulabılırsınız.

<CommandDefinition Id="ISKO.SubGrid.opportunityproduct.MainTab.Actions.CloseAsLost.Command">
            <EnableRules/>
            <DisplayRules/>
              <Actions>
              <JavaScriptFunction FunctionName="CustomPageOpen"
                                                    Library=" $webresource: new_RibbonButton "/>
            </Actions>
          </CommandDefinition>

Eğer direkt olarak url verip o url adresini görüntülemek istiyorsak;
<CommandDefinitions>
    <CommandDefinition Id="Gokhan.account.Form.Star.Command">   
       <EnableRules />   
      <DisplayRules />  
       <Actions>    
             <Url Address="http://gkhnmnts.blogspot.com/" />    
        </Actions>   
     </CommandDefinition>
 </CommandDefinitions>

Javascript

Library nın adı :new_RibbonButton olsun.(Bu library i crm içerisinde customizations altında webresource bolumunden acabılırsınız.)

function CustomPageOpen(){
   var url="http://deneme:12/CustomPageOpen.aspx?degisken1=gokhan&degisken2=mentese";
 
   window.open(url,'','');
}



18 Temmuz 2013 Perşembe

CRM 2011 - Unable to cast object of type Microsoft.Xrm.Sdk.Entity

 Plug-in
Servise baglantımızı yukarıdakı koddaki gibi yapıyorsak kodumuzu asagıdkı gibi güncellememiz gerekmektedir.

 serviceFactory.GetType().GetProperty("ProxyTypesAssembly").SetValue(serviceFactory, typeof(XrmServiceContext).Assembly, null);





IOrganizaton service kullanarak baglantımızı gerceklestırıyorsak ;

 _serviceProxy.EnableProxyTypes(); bolumunu koda eklememız yeterlı olacaktır.

 public static IOrganizationService GetCrmService()
        {
            try
            {
                IOrganizationService _crmService = null;
                OrganizationServiceProxy _serviceProxy = null;
                ClientCredentials _objCredentials = null;
                string _strCrmURL = string.Empty;
                _objCredentials = new ClientCredentials();
                _objCredentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;

                _strCrmURL ="http://deneme:port/organizationname/XRMServices/2011/Organization.svc"

                    Uri organizationUri = new Uri(_strCrmURL);
                    Uri homeRealmUri = null;
                    _serviceProxy = new OrganizationServiceProxy(organizationUri, homeRealmUri, _objCredentials, null);

                    _serviceProxy.EnableProxyTypes();
                    _crmService = (IOrganizationService)_serviceProxy;

                return _crmService;
        }

17 Mayıs 2013 Cuma

CRM 2011 JAVASCRIPT - LOOKUP ALANA DEĞER ATAMA

(How to set up a lookup  using Javascript) 

CRM 4

var deger= new Array();
deger[0] = new Object();
deger[0].id = idValue;
deger[0].name = textValue;
deger[0].typename = typeValue;
crmForm.all.fieldName.DataValue = deger;

CRM 2011

var deger = new Array();
deger[0] = new Object();
deger[0].id = idValue;
deger[0].name = textValue;
deger[0].entityType = typeValue;
Xrm.Page.getAttribute(“fieldName”).setValue(deger);

Tek satırda da değer atama.

CRM 4
     crmForm.all.field.DataValue = [{id: idDegeri, name: text, typename: tip}];

CRM 2011
     Xrm.Page.getAttribute(“fieldName”).setValue( [{id: idDegeri, name: text, entityType: tip}]);

3 Mayıs 2013 Cuma

CRM 2011 - FORMA GOOGLE MAPS EKLEME (Display Google Maps in CRM 2011)


Bu yazımda ,Html webresource kullanarak crm 2011 de google maps gösterecegiz.

Client

<html>
<head>
    <title>Map</title>
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"> </script>
    <script type="text/javascript" src="../WebResources/crm_googleMap.js"></script>
</head>
<body onload="InitializeMap()">
    <div id="map_canvas" style="width: 100%; height: 380px;">
    </div>
</body>
</html>

Javascript metotları

var geocoder = null;
var map = null;
function InitializeMap() {
    if (typeof google !== "undefined") {
        geocoder = new google.maps.Geocoder();
        var latlng = new google.maps.LatLng(17.384509, 78.486156);
        var myOptions = {
            zoom: 15,
            center: latlng,
            scaleControl: true,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
        codeLatLng(latlng);
    }
}

function codeLatLng(latlng) {
    geocoder.geocode({ 'latLng': latlng }, function (results, status) {
        if (results != null && status != null) {
            if (status == google.maps.GeocoderStatus.OK) {
                map.setCenter(results[0].geometry.location);
                var marker = new google.maps.Marker({
                    map: map,
                    position: results[0].geometry.location
                });
            }
            map.setZoom(10);
        }
    });
}

9 Nisan 2013 Salı

CRM 2011 -Ribona Grup Buton Ekleme (Adding a new Button Group to the CRM Ribbon)


<CustomActions>
  <CustomAction Id="Mscrm.Form.account.CustomGroup.CustomAction"
                Location="Mscrm.Form.account.MainTab.Groups._children"
                Sequence="110">
    <CommandUIDefinition>
      <Group Id="Mscrm.Form.account.CustomGroup.Group"
              Command="Mscrm.Form.account.CustomGroup.Command"
              Title="Group Button"
              Sequence="51"
              Template="Mscrm.Templates.Flexible2">
        <Controls Id="Mscrm.Form.account.CustomGroup.Controls">
          <Button Id="Mscrm.Form.account.CustomGroup.Button.Buton1"
                  Command="Mscrm.Form.account.CustomGroup.Button.Buton1.Command"
                  Sequence="10"
                  LabelText="Button 1"
                  ToolTipTitle="TipTitle"
                  ToolTipDescription="TipDescription"
                  TemplateAlias="o1"
                  Image16by16="/_imgs/ribbon/newchart16.png"
                  Image32by32="/_imgs/ribbon/newchart32.png"  />
          <Button Id="Mscrm.Form.account.CustomGroup.Button.Buton2"
                  Command="Mscrm.Form.account.CustomGroup.Button.Buton2.Command"
                  Sequence="20"
                  LabelText="Button 2"
                  ToolTipTitle="TipTitle"
                  ToolTipDescription="TipDescription"
                  TemplateAlias="o1"
                  Image16by16="/_imgs/ribbon/CustomEntity_16.png"
                  Image32by32="/_imgs/ribbon/CustomEntity_32.png"   />
        </Controls>
      </Group>
    </CommandUIDefinition>
  </CustomAction>
  <CustomAction Id="Mscrm.Form.account.CustomGroup.MaxSize.CustomAction"
                Location="Mscrm.Form.account.MainTab.Scaling._children"
                Sequence="120">
    <CommandUIDefinition>
      <MaxSize  Id="Mscrm.Form.account.CustomGroup.MaxSize"
                GroupId="Mscrm.Form.account.CustomGroup.Group"
                Sequence="21"
                Size="LargeLarge" />
    </CommandUIDefinition>
  </CustomAction>
  <CustomAction Id="Mscrm.Form.account.CustomGroup.Popup.CustomAction"
                Location="Mscrm.Form.account.MainTab.Scaling._children"
                Sequence="140">
    <CommandUIDefinition>
      <Scale    Id="Mscrm.Form.account.CustomGroup.Popup.1"
                GroupId="Mscrm.Form.account.CustomGroup.Group"
                Sequence="85"
                Size="Popup" />
    </CommandUIDefinition>
  </CustomAction>
</CustomActions>