Wednesday, July 20, 2011

MySQL Keyword for Retrieving the Top 1000 records

We need to use the limit keyword for this. This is equal to Top keyword in MSSQL server.

Select  * from [DatabaseName].[tablename] Limit 1,1000

Oracle Extract Function

This function is pretty much similar to SQL datepart function. Syntax is given below. This was taken from the below URL. 


EXTRACT ({ YEAR | MONTH | DAY | HOUR | MINUTE | SECOND }
| { TIMEZONE_HOUR | TIMEZONE_MINUTE }
| { TIMEZONE_REGION | TIMEZONE_ABBR }
FROM { date_value | interval_value } )

You can take year, month and day separately using this function.


extract(YEAR FROM DATE '2011-07-20') would return 2011
extract(MONTH FROM DATE '2011-07-20') would return 7
extract(DAY FROM DATE '2011-07-20') would return 20

Wednesday, July 6, 2011

Adding a Dataset value to a TextBox in Header or Footer of the report

Is this possible?
No, it is not. When you do this and try to view the report you get an error stating that cannot add dataset values to report header or footer.

Is there a way to overcome this?.
Fortunately there is. How?.

You can add a textbox to the report body and you can set the expression of that textbox to a dataset value. Then you can assign this text box as a report parameter to the text box in your header. works like a charm.

However if you want the footer or header to be repeating in all the pages of the report you need to add columns to the report table. Then you need to hide them and assign to report header or footer textboxes.

Tuesday, July 5, 2011

CRM4 SQL Functions

There are a lot of SQL functions that we can use when we are doing reports in CRM. The following  article describes about them.

http://blogs.infinite-x.net/2009/02/20/using-built-in-crm-functions-when-writing-sql-reports/

Difference between Parent and Child Pipelines

We see this a lot when we publish plugins through the plugin deployer. We don't tend to notice this as we most of the time user Parent pipeline. But why there is another Pipe Line.

The reason for this is simple.

If you open the entity from CRM without going to it from another CRM record this would be the parent pipe line.
If you go to the same entity record through another entities record it would be the child pipe line.

If you have written a plugin for a particular entity and have used the parent pipe line then it would not fire id the same scenario happens if you have to come the record through another record.

There is a very nice article about this written in the following web link. This helped me too to understand the difference. This was given to me by a colleague of mine.

http://crmscape.blogspot.com/2009/02/ms-crm-40-plug-in-stages-pipelines-and.html

Tuesday, June 21, 2011

Assigning Null Values to Generics - Is it Allowed

We cannot assign null values to generics. The reason behind this is a generic might take a reference type or value type. As we know value types cannot be assigned with null value. How can we overcome this?.

We can us the default keyword with generics. Then reference types will be assigned with null if a value is not there and a value type would be given it's appropriate value.

T Name = Default(T);

Here T is a generic variable.

Thursday, June 16, 2011

CRM 4 - Invalid email Error when creating an Appointment

Error Message: Invalid e-mail address. For more information, contact your system administrator.

You might get an error message when creating an appointment stating invalid email address. When you check the records you will see that the email address is correct and you might be wondering why on earth that you are getting an error message like this. 

The reason is simple. although your email address is a valid email address if one the letters contain an invalid character the you get this error message.

e.g: abdñaddd@test.com

The letter n contains and invalid character for the email address. Once you get rid of that this would start working fine.

e.g: abdnaddd@test.com

Retrieving Calendar of a Bookable Resource in Dynamics

There are occasions where we need to retrieve working days and working times of a resource in Dynamics grammatically. This is quite possible...