May 14

CRM 4.0 size of notes section

This forum-post gave me the idea to work out a solution to the question asked :

http://social.microsoft.com/Forums/en-US/crm/thread/89530c2b-7a95-4553-816a-b2620d0a7a92/#9edeefd1-674f-4e61-a17f-a7403476e090

So I got started on my CRM 4.0 vpc and indeed, it’s not resizable :

unchangable notes section

So I went in with IE Developer toolbar and take a look in source :

notes in an iframe

And we kan fix it in the onLoad of the form :

crmForm.all.notescontrol.style.height = '100px';

And this is how the cookie crumbles :

notes resized in another tab

Mar 04

CRM 4.0 Update DynamicEntity with CrmDateTimeProperty

Scenario : we have a guid for an incident and we have a datetime string and we need to update this incident with the new datetime. The only problem is : this datetime field is not a standard attribute for the incident entity. So we need Dynamic Entities. The standard code in the SDK gives us an example of retrieving the DynamicEntity (little modification for my incidents) :

ColumnSet cols = new ColumnSet(EntityName.incident.ToString());
cols.AddColumn("incidentid");
cols.AddColumn("xxx_incidenthandledate");

TargetRetrieveDynamic targetRetrieve = new TargetRetrieveDynamic();
targetRetrieve.EntityName = EntityName.incident.ToString();
targetRetrieve.EntityId = incidentGuid;
RetrieveRequest retrieve = new RetrieveRequest();
retrieve.Target = targetRetrieve;
retrieve.ColumnSet = cols;
retrieve.ReturnDynamicEntities = true;

RetrieveResponse retrieved = (RetrieveResponse)service.Execute(retrieve);

DynamicEntity theIncident = (DynamicEntity)retrieved.BusinessEntity;

After this we can update the attribute value of the incident with the new datetime :

CrmDateTimeProperty theNewIncidentHandleDate = new CrmDateTimeProperty();
theNewIncidentHandleDate.Name = "xxx_incidenthandledate";
theNewIncidentHandleDate.Value = new CrmDateTime( string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:s}", theNewDateTime));

PropertyCollection propcol = new PropertyCollection();
propcol.Add(theNewIncidentHandleDate);
theIncident.Properties = propcol;

TargetUpdateDynamic updateDynamic = new TargetUpdateDynamic();
updateDynamic.Entity = theIncident;

UpdateRequest update = new UpdateRequest();
update.Target = updateDynamic;

UpdateResponse updated = (UpdateResponse)service.Execute(update);

The only problem is : the SoapException I got…

Apparently, I needed to ad my incidentid to the PropertyCollection. Why? Because the webservice method needs to know which incident we need to update…
Yes… I was that stupid. I was looking at that freakin SoapException for about half an hour. Until my colleague Maarten van Sambeek saved me with just one line of code :

propcol.Add(theIncident.Properties.OfType().First());

We could go and build a new KeyProperty, add the name and the value of the incidentid and add it to the PropertyCollection.
What we do is use Linq to get the first Property of type KeyProperty. Yes, that happens to be the incidentid :)

Et voila : a nicely working update of a CrmDateTimeProperty for a DynamicEntity!

Mar 04

New job, new employer : Winvision

And… I’ am back! I have worked for Sogyo for about 4 years now, and I needed a change. Since I started working for Sogyo, my interests lie with web development and especially Sharepoint. The last year at Sogyo I got to work on Microsoft Dynamics CRM 4.0 and it was love at first sight, so… I wanted something else and I really want to develop on Sharepoint and/or on CRM 4.0 (and now a little bit CRM 2011 in my spare time!)

Winvision offered me exactly that, and that is what I am doing right now! For Winvision, I now work (for almost a year now!) as an application manager (customers report a bug or an RFC, I fix it, report it back, happy customer, happy me) and I love it! I am doing some ASP.NET development, some little modifications in Sharepoint 2007 and 2010 solutions, and lately I am working on some CRM 4.0 calls for a few customers.

SogyoWinvision

Jun 30

CRM 4.0 Insufficient Permissions with assigning records

Another short one for CRM 4.0…

Today someone from Sales department tried to assign an entity (this time a Contact, previous time an Account) to someone else. In cleaning up and/or deviding contacts within the Sales team, this is a daily routine and common practice for our Sales people.

The error that the Sales person got had something to do with insufficient permissions on assigning an entity and that the role he/she was in, did not have enough permissions :

 

My first thought was : bullshit!

In my search for an answer, I discovered some interesting facts… (and a sleezy solution of course! )

  • The standaard role that the Sales person had, was enough to assign entity-records to himself or anyone else.
  • Even the CRM System Admin user could not assign the entity-record to someone.
  • Other entity-records are easily assigned to other people.

Solution

This is just a temporary one (hopefully), until we install Update Roll Up #4 :

  1. Give the System Administrator securityrole to the CRM-user that got the “insufficient permissions” error.
  2. Let the user assign the entity-record to the designated CRM-user.
  3. Remove the System Administrator securityrole.

That’s that! If there is anyone in CRM world that had this same problem, please leave a comment! I’m interested in a more… well… a better solution :)

Jun 09

CRM 4.0 Use Filtered Views in report projects

Just a quick CRM 4.0 tip when you are working on Custom Reports in Visual Studio 2005.

Filtered views.JPG

Use Filtered Views instead of Tables or Views, otherwise you will recieve errors when running the report after importing it :

An error has occurred during report processing.
Query execution failed for data set 'Test_Dataset'
For more information about this error navigate to the report server on the local server machine, or enable remote errors

May 29

CRM 4.0 asp.net postbacks and viewstate

A little while ago, I was having trouble with postbacks and databound dropdownlists in a custom ASP.NET applicaion for CRM 4.0. After struggling for a day and sticking my head in the sand for a month, I picked up the problem for the last time. I was going to nail this sucker!

Going back to basics and suddenly I started thinking : But what was the solution?

Viewstate in ASP.NET! So after some digging, some google I found my hero : Gustaf Westerlund.
Add this line to your web.config of your custom ASP.NET application for CRM 4.0 and you are done :

<pages enableViewState="true" />

Shame on me for not seeing that in an earlier stage!

The viewstate in your web.config in the root of your CRM installation is set to false. That means that every site “beneath” that root level is taking over this viewstate setting… To false! So basically… Viewstate is evil! ASP.NET is scary!

Ow…yeah… and don’t forget to enable this property for your databound controls :

AppendDataBoundItems="True"

Dit lost dus voor mij een berg problemen met databinding en postbacks op, misschien heeft die ene trouwe lezer van mijn blog er wat aan? ;)

This is solving a lot of databinding and postback problems! Maybe I’m helping that one reader of my blog with this? ;)

PS: Gustaf, thank you very much!

May 01

CRM 4.0 Duplicate Detection in code

Duplicate detection in CRM 4.0 is a nice tooling for frontend-users and works like a charm, but what if you want to do this in code? The MSDN API is not telling me enough and google search isn’t much of a help at all.

Therefore I posted some code which shows creation of a contact-record with duplicate detection :

contact eenContact = new contact();
eenContact.firstname = "Bert-Jan";
eenContact.lastname = "Diedering";
eenContact.address1_city = "Utrecht";

TargetCreateContact target = new TargetCreateContact();
target.Contact = eenContact;

CreateRequest request = new CreateRequest();
request.Target = target;
request.OptionalParameters = new OptionalParameter[]
{
new CreateDuplicatesOptionalParameter {Value = false}
};

CreateResponse response = (CreateResponse)client.Execute(request);

Also read a few words about the OptionalParameter.

Apr 01

CRM 4.0 plugin for dummies

Wanneer je op onderzoek gaat in de wereld van plugins voor Microsoft Dynamics CRM 4.0, dan komen er vragen boven. Wat moet er gebeuren om een plugin te kunnen maken/gebruiken. Wat is bijvoorbeeld het verschil tussen een workflow en een plugin? Wat is de inhoud van de context gevoelige objecten? Is debuggen mogelijk en zo ja : hoe? Daar kan ik een heel mooi epistel over schrijven maar dat kunnen anderen ook.

Deze vragen worden in deze post beantwoord aan de hand van een scenario, om een beeld te krijgen van een mogelijk doel van een plugin.

Read the rest of this entry »

Mar 08

Customization tips voor CRM 4.0

In deze posts geef ik een aantal tips die je kunnen helpen bij de customizations in CRM 4.0.

Tip 1 : salutation veld vervangen door custom attribute

De Contact entiteit binnen CRM 4.0 heeft een attribuut genaamd “salutation”. Dit is een tekstveld en wordt bij het synchroniseren met Microsoft Outlook gekoppeld aan het Title veld van een Outlook-contactpersoon. Het nadeel hiervan is dat je in de contactpersonen lijst van Outlook dus ook in de “Full Name” kolom dan bijvoorbeeld “Geachte Piet Pietersen” ziet staan.

salutation.JPG

Voor degenen die hun Outlook syncrhoniseren met hun telefoon is het dan een ramp om contactpersonen te zoeken of er doorheen te bladeren. Om dit op te lossen kun je bijvoorbeeld een vervangende picklist maken met de naam “new_salutation”. Hierin kun je dan bijvoorbeeld “Geachte” en “Beste” opgenomen.

Tip 2 : Customizations importeren en exporteren

De volgende stappen van aanmaken van een attribuut en het exporteren en importeren van een nieuwe attribuut met dezelfde naam, resulteren in een foutmelding.

  1. Maak een attribuut aan genaamd “new_test” van het type nvarchar en plaats deze op een form.
  2. Publish je wijzigingen en exporteer de wijzigingen naar de desktop.
  3. Ga nu terug naar je attribuut “new_test” en verwijder deze van het form.
  4. Publish je wijzigingen.
  5. Verwijder nu het attribuut uit CRM en publish je wijzigingen opnieuw.
  6. Maak nu een nieuw attribuut aan genaamd “new_test” van het type Picklist en plaats deze op een form.
  7. Publish de wijzigingen.
  8. Importeer nu de eerder geexporteerde wijzigingen en je zult zien dat dit niet gaat :

import customization.JPG

De exacte foutmelding is deze :

Failure: lead: AttributeInfo.TypeName(nvarchar) != AttributeMetadata.Type.Name(picklist)

De conclusie hierbij is dus dat het niet mogelijk is om een attribuut te importeren waarvan de naam al bestaat, ook al is het type anders.

Kies de benaming van nieuwe attributen dus zorgvuldig. Zorg dat je niet dezelfde attribuut namen hebt.

Tip 3 : Bewaar backups van je customizations

Als je het slim aanpakt, heb je de VPC van Microsoft Dynamics CRM 4.0 gedownload die je als lokale testmachine gebruikt. Nog verstandiger is een Acceptatie server in een apart domein in je netwerk. Voordat je de customizations exporteerd naar de Productie omgeving heb je al minstens 2 exports gedaan van de customizations. Om daar enigszins overzicht in te bewaren, kun je naar mijn idee het beste een SVN-repository vol met zip bestanden gebruiken. SVN is gratis en de SVN client genaamd Tortoise is ook gratis.

Nov 06

Timer functie voor workflows in CRM 4.0

Wie met CRM 4.0 werkt, weet dat het gebruiken van workflows een hoop werk kan besparen. Je kunt bijvoorbeeld een workflow starten op het moment dat er een CRUD operatie op een record wordt uitgevoerd, of wanneer een status van een record gewijzigd wordt. Wat door CRM 4.0 standaard niet beschikbaar is, is een timer functie. Om bijvoorbeeld alerts op een einddatum te kunnen versturen, hebben we een timer nodig. Hieronder laat ik zien hoe je je eigen implementatie van alerts kunt maken in CRM 4.0.

Read the rest of this entry »

Older posts «

%d bloggers like this: