Tuesday, October 30, 2007

Object reference not set to an instance of an object

When coding callouts:

string qualifiedStatus = opportunity.new_qualifiedstatus.Value.ToString();

new_qualifiedstatus is a picklist. If we haven't selected any value from that picklist we will get a null reference exception (not an empty or null string). So the right way to assign this would be:

if(opportunity.new_qualifiedstatus != null)
{
string qualifiedStatus = opportunity.new_qualifiedstatus.Value.ToString();
}

Saturday, October 27, 2007

Be a pointer my friend

Empty your memory,
with a free()….
like a pointer!
If you cast a pointer to a integer,
it becomes the integer,
if you cast a pointer to a struct,
it becomes a struct….
The pointer can crash…,
and can Overflow…
Be a pointer my friend….

Thursday, October 25, 2007

Hammer tool

Sometimes, when the only tool you have is a hammer, every problem starts to look like a nail.

Tuesday, October 23, 2007

Disable a field - CRM javascript

How to disable a field on a CRM form? A picture is worth a thousand words.