31 Ocak 2010 Pazar

Why nothing is working ?!


You are trying to run a custom application which talks to CRM webserivce but it's throwing exception like "Microsoft.Crm.WebServices.Crm2007.MultipleOrganizationSoapHeaderAuthentica-tionProvider,Microsoft.Crm.WebServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' doesn't exist" than don't worry.

One single dll can fix all your problems. Find "Microsoft.Crm.WebServices.dll" from somewhere (start searching from CRM server itself) Did you find it?Cool. Type "assembly" to Run window and check GAC. The thing that you should do is drag&drop this dll to GAC window. Let it copy the dll. Restart the IIS and thank.



2 kişinin bildiği sır degildir.

CRM webservis'iyle münasebeti olan bir uygulaman mı var? Çalıştırmaya kalkınca şu hatayı mı alıyorsun "Microsoft.Crm.WebServices.Crm2007.MultipleOrganizationSoapHeaderAuthentica-tionProvider,Microsoft.Crm.WebServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' doesn't exist" o zaman korkma hacı, ilacı var.

Bildigin tek bir dll seni iyi eder. "Microsoft.Crm.WebServices.dll" diye bi dosya var sagdan soldan biyerden bul bunu, aramaya server'dan başla, buldun mu?helal. O her bogumunda kıl olan parmaklarınla Run penceresinde "assembly" yaz da GAC'ı bi görelim. Şimdi o buldugun dosyayı GAC penceresinin üzerine sürükleyip bırak. Bi de IIS reset çak, saol desene !

30 Aralık 2009 Çarşamba

CRM Customization BackUp Tool

If you are a member of development team I'm sure your friends or maybe you will overwrite CRM customizations; Means,someone will lose customization, or let's say you have to revert customizations back to 1 month ago.

You can use "CRMUtilities-CustomizationBackUp" plugin to get backup of current customizations before importing new one. Once you register this plugin and try to import a customization system will export all current customizations to local folder, so you'll have all versions of customizations.

Download the file which contains required Dll and ReadMe.doc

Customization kaybetmeye son:

Takım arkadaşlarınız sizin özelleştirmelerinizi mi eziyor yada siz güncellemelerinizi unutup kendi customization dosyalarını mı eziyorsunuz, hiç olmadı belirli bir tarihteki customization'lara dönmek mi istiyorsunuz. İşte size CustomizationBackUp plugini.
Yeni herhangi bir özelleştirme yüklemek istediginizde sistem otomatik olarak mevcut tüm özelleştirmeleri belirli bir konuma kopyalar, böylece tüm customization geçmişine sahip olursunuz.

Dosyayı Indir, gerekli Dll ve BeniOku içindedir.

30 Kasım 2009 Pazartesi

Why it's not updating owner field of record?

Because most probably you are trying to set ownerid field like:

contact.ownerid = new Owner();
contact.ownerid.type = EntityName.systemuser.ToString();
contact.ownerid.Value = [SystemUserGuid];

which is wrong.

Changing the ownership of a record is not that much easy, you should call another CrmService method, so here is the solution:

SecurityPrincipal securityPrincipal = new SecurityPrincipal();
securityPrincipal.Type = SecurityPrincipalType.User;
securityPrincipal.PrincipalId = new Guid(newOwnerID);

TargetOwnedContact target = new TargetOwnedContact();
target.EntityId = new Guid(contactID);

AssignRequest assignRequest = new AssignRequest();
assignRequest.Assignee = securityPrincipal;
assignRequest.Target = target;

AssignResponse assignResponse = (AssignResponse)crmService.Execute(assignRequest, null, null); //CRMWebServiceCall


Yani diyor ki:
Çünkü büyük ihtimalle ownerid için şöyle bir atama yapıyorsunuz:

contact.ownerid = new Owner();
contact.ownerid.type = EntityName.systemuser.ToString();
contact.ownerid.Value = [SystemUserGuid];

ki yanlış.

Bir kaydın sahibini(owner) değiştirmek o kadar kolay degildir ki bu noktada başka bir webservis çagrısı yapmak durumundasınız. Şu aşağıdaki kod blogu size fikir cerecektir:

SecurityPrincipal securityPrincipal = new SecurityPrincipal();
securityPrincipal.Type = SecurityPrincipalType.User;
securityPrincipal.PrincipalId = new Guid(newOwnerID);

TargetOwnedContact target = new TargetOwnedContact();
target.EntityId = new Guid(contactID);

AssignRequest assignRequest = new AssignRequest();
assignRequest.Assignee = securityPrincipal;
assignRequest.Target = target;

AssignResponse assignResponse = (AssignResponse)crmService.Execute(assignRequest, null, null); //CRMWebServiceCall


28 Ekim 2009 Çarşamba

Attach External JavaScript File


I'm sure you have common functions that you are using in many entity's javascript part(onLoad,onChange,onSave). Actually the best inheritance is not copy-paste so you can keep all those functions in one *.js file and while form is loading you can attach to form with the following way.

var script = document.createElement('script');
script.language = 'javascript';
script.src = '/CustomScripts/MyCustomJavascriptFile.js';
document.getElementsByTagName('head')[0].appendChild(script);
script.onreadystatechange = function()
{
if (this.readyState == 'complete' || this.readyState == 'loaded')
{
//You can call your functions here.
}
}


We will be adding some useful functions to this javascript file on next posts.

Televizyonunu yeni açan seyircilerimiz için:
Yapmayın. Öyle bir fonksiyonu lazım olan her entity için sürekli kopyala yapıştır yapmayın, ayıp. Insan gibi bir base javascript dosyanız olsun; gerekli, en az 2 defa kullanılmış fonksiyonları bu dosyada toplayın sonra hangi entity'den istiyorsanız onun pageLoad fonksiyonuna aşagıdaki blog'u yazın, bitsin.

var script = document.createElement('script');
script.language = 'javascript';
script.src = '/CustomScripts/MyCustomJavascriptFile.js';
document.getElementsByTagName('head')[0].appendChild(script);
script.onreadystatechange = function()
{
if (this.readyState == 'complete' || this.readyState == 'loaded')
{
//şimdi burdan paşa paşa çagır fonksiyonunu.
}
}


Sonraki postlarda "işe yarar, ooo helal, yok artık" şeklindeki fonksiyonları ekleyecegiz.