Microsoft KB Archive/941934

= The current user appears in an incorrect field when you create a new activity in Microsoft Dynamics CRM 3.0 =

Article ID: 941934

Article Last Modified on 11/21/2007

-

APPLIES TO


 * Microsoft Dynamics CRM 3.0

-



SYMPTOMS
Consider the following scenario in Microsoft Dynamics CRM 3.0. You customize the Phone Call entity by changing the default value of the Direction attribute. For example, you change the value in the Default Value field from Incoming to Outgoing. Or, you change the value in the Default Value field from Outgoing to Incoming. Then, you create a new Phone Call activity. In this scenario, the current user appears in an incorrect field.

If you change the value in the Default Value field to Outgoing, the current user unexpectedly appears in the Recipient field instead of in the Sender field. If you change the value in the Default Value field to Incoming, the current user unexpectedly appears in the Sender field instead of in the Recipient field.

This problem also occurs when you customize the following entities by changing the default value of the Direction attribute:
 * The E-mail entity
 * The Fax entity
 * The Letter entity

Note If you create a new E-mail activity, the current user appears in the From field or in the To field instead of in the Sender field or in the Recipient field.



WORKAROUND
To work around this problem, use one of the following methods.

Method 1
Manually type the current user in the appropriate field when you create an activity of the entity.

For example, you change the value in the Default Value field to Outgoing for the Phone Call entity. When you create a new Phone Call activity, type the current user in the Sender field. Then, delete the current user from the Recipient field.

Method 2
For the entity that you want to use, create the logic for the OnLoad event and for the OnChange event of the Direction Code field.

The logic should use the value of the directioncode attribute to make sure that the current user appears in the appropriate field. If the value of the directioncode attribute specifies an incoming event, the logic should set the current user to be the recipient. If the value of the directioncode attribute specifies an outgoing event, the logic should set the current user to be the sender.

For example, use the following code example as the logic. var CRM_CREATE_FORM = &quot;1&quot;; var formType = crmForm.FormType; var directionCode = crmForm.all.directioncode.DataValue if(formType == CRM_CREATE_FORM) {

try { if (crmForm.all.torecipients.DataValue[0].name = null) { if(directionCode == 2) /*Outgoing*/ { crmForm.all.from.DataValue = new Array; crmForm.all.from.DataValue[0].name = crmForm.all.owner.DataValue[0].name; crmForm.all.from.DataValue[0].typename = crmForm.all.owner.DataValue[0].typename; crmForm.all.from.DataValue[0].id = crmForm.all.owner.DataValue[0].id; crmForm.all.from.DataValue[0].type = crmForm.all.owner.DataValue[0].type; } if(directionCode == 1) /*Incoming*/ { crmForm.all.torecipients.DataValue = new Array; crmForm.all.torecipients.DataValue[0].name = crmForm.all.owner.DataValue[0].name; crmForm.all.torecipients.DataValue[0].typename = crmForm.all.owner.DataValue[0].typename; crmForm.all.torecipients.DataValue[0].id = crmForm.all.owner.DataValue[0].id; crmForm.all.torecipients.DataValue[0].type = crmForm.all.owner.DataValue[0].type; } } }

catch(e) { }

}



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Keywords: kbexpertisebeginner kbtshoot kbmbsmigrate kbbug kbexpertiseinter KB941934

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.