Using Property Collection in MS CRM 4.0

While using Properties in MS CRM 4.0 one has to be careful as to which dotnet namespace you are instantiating it from. For MS CRM purposes, you need to make sure you instantiate it from Microsoft.crm.sdk and not from System.Data namespace. If you type the following code

PropertyCollection pc_Dummy = new PropertyCollection();

In the above line the word “Property Collection” will be show in Red in the Visual Studio IDE. This can be resolved using the following piece of declaration code. Continue reading

Working with Custom Entites in MS CRM 4.0

Working with Custom Entities has been a little tough on me because of the High Learning curve involved.  Finally I did win over and learnt quite a bit about using these entities in custom pages. It’s actually quite simple to work with the custom entities. Here’s a piece of code which will get the custom entity into a dynamic entity for us

1
2
3
4
5
6
//Create of New information the custom entity
DynamicEntity de_Custom = new DynamicEntity();
de_Custom.Name = "CustomEntityName";
de_Custom.Properties = PropertiesCollectionObject;
TargetCreateDynamic tcd_Custom = new TargetCreateDynamic();
tcd_Custom.Entity = de_Custom;  <a href="http://www.programmingfundas.com/blog/2008/11/29/working-with-custom-entites-in-ms-crm-40/#more-19" class="more-link">Continue reading <span class="meta-nav">&rarr;</span></a>

Using Dynamic Entity in MS CRM 4.0

The other day, I was helping my wife with one of the issues she was facing in MS CRM 4.0. The code was basically trying to get an instance to the running crmwebservice and use that instance to create a contact or a update a contact in MS CRM.  The issue we were facing in particular, was a type casting issue where an implicit cast of PropertyCollection to Property was not being done. After some research here and here. We ended up with the following code Continue reading

Updating Items in Collection

I have been working with collections for sometime now, i had always either deleted or added item in the collection but never updated. Today i had a need to do that, when i searched i couldn’t find a direct method to get a item in a collection updated. After some confusing moments i ended up the following code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Dim t As New Collection
Dim iRemove As Integer
Dim iCnt As Integer
 
iRemove = 3
t.Add ("te")
t.Add ("ew")
t.Add ("Ad")
t.Add ("Adtree")
t.Add ("tewww")
MsgBox t(iRemove)
Call t.Add("Ads", , IIf(iRemove = t.Count, iRemove, iRemove + 1))
For iCnt = 1 To t.Count
Debug.Print t(iCnt)
Next
t.Remove (IIf(iRemove + 1 = t.Count, iRemove + 1, iRemove))
MsgBox t(iRemove)
 
For iCnt = 1 To t.Count
Debug.Print t(iCnt)
Next

Nothing too fancy in that code, so far it has worked fine but will wait till i implement it in the main code to celebrate 😉 :D. On another note, i have been reviewing UCertify’s PrepEngine, I must say it’s pretty darn good. Soon, in couple of days, you see a full review of their product in my blog.

Turning off gridlines in Excel Worksheet

I spent half of yesterday figuring out this. So i am posting it here so that it will be reminder for me and for other’s :). Here are the instructions…

  1. Select the worksheet.
  2. Goto Tools->Options->View tab – Windows Options section.
  3. Check or Uncheck Gridlines to show or hide them.