In Microsoft Business Solutions CRM version 1.2, custom fields are not defined or populated when you create a record using the Microsoft CRM SDK (873313)



The information in this article applies to:

  • Microsoft CRM Software Development Kit, when used with:
    • Microsoft CRM 1.2
  • Microsoft CRM 1.2

SYMPTOMS

You have created a workflow rule that responds to the create event of an entity. The rule contains a condition that checks the value of a custom boolean field of the entity. An e-mail is sent based on the value of the boolean field. The e-mail is not being sent if the entity is created by using the create method in the Microsoft CRM SDK.

This problem is not confined to code executed from a workflow rule. You might experience different symptoms depending on the type or object and custom fields in your solution.

CAUSE

The value of a custom field is not automatically set to its default value when you create a record outside the Microsoft CRM application user interface. For example, you create a record through a platform call using the CRMIncident.Create method and do not set the value of a custom field in the IncidentXML parameter.

RESOLUTION

The XML string passed to the create method must contain any custom fields as shown by the following example:

// Set up the XML string for the new case (incident).
strIncidentXml = "<incident>";
strIncidentXml += "<title>" + "Case" + "</title>"; 
strIncidentXml += "<accountid>" + strAccountId + "</accountid>";
strIncidentXml += "<prioritycode>" + "1" + "</prioritycode>";
// Workaround for a custom field. For a boolean, the default value must be set to "0".
strIncidentXml += "<CFBCustomField>" + "0" + "</CFBCustomField>";
strIncidentXml += "</incident>";

Modification Type:MinorLast Reviewed:9/7/2006
Keywords:kbMBSemail kbMBSworkflow kbMBSMigrate kbinfo KB873313 kbAudDeveloper