locked
How to set one field equal to another in 4.0 (or two) RRS feed

  • Question

  • Wihtin an Event Response (or any place you want one field to equal another field) I want to be able to set the Subject field equal to the concatenation of the "Response Code" and "Regarding field". I came up with the basic concatenation to do this but I am certain it needs a bit more logic such as verifying that both a subject and regarding field have been selected. I also assume that I can use this Jscript in the onsave and that it can even occcur. Any help appreciated. Thanks.

    crmForm.all.subject = crmForm.all.responsecode + ' ' + crmForm.all.regardingobjectid;
    Thursday, September 17, 2009 8:20 PM

All replies

  • Hi.

    You can try to use following script:

    crmForm.all.subject.DataValue = crmForm.all.responsecode.SelectedText + ' ' + (crmForm.all.regardingobjectid.DataValue == null ? '' : (crmForm.all.regardingobjectid.DataValue[0].name);

    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Thursday, September 17, 2009 8:57 PM
    Moderator
  • Andriy,

    I tried to troubleshoot it but I am gettting the following error (Dev errors on). Any suggestions?

    ----

    Error Details:
    Exception of type 'System.Web.HttpUnhandledException' was thrown.

    Full Stack:
    [FileNotFoundException: C:\Program Files\Microsoft Dynamics CRM\Server\bin\CrmVerServer.dll]
       at System.Diagnostics.FileVersionInfo.GetVersionInfo(String fileName)
       at Microsoft.Crm.Application.Utility.ApplicationVersion..cctor()
    
    [TypeInitializationException: The type initializer for 'Microsoft.Crm.Application.Utility.ApplicationVersion' threw an exception.]
       at Microsoft.Crm.Application.Utility.ApplicationVersion.get_FullVersion()
       at Microsoft.Crm.Dialogs.ScriptErrorDialogPage.ConfigurePage()
       at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    
    [HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown.]
       at System.Web.UI.Page.HandleError(Exception e)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
       at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
       at System.Web.UI.Page.ProcessRequest()
       at System.Web.UI.Page.ProcessRequest(HttpContext context)
       at ASP.dhsstakeholderengagement__common_error_dlg_scripterror_aspx.ProcessRequest(HttpContext context)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    
    Friday, September 18, 2009 2:23 PM
  • Hi.

    It seems that there are some issues in plugins. Do you have plugin registered on this entity?
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Friday, September 18, 2009 2:30 PM
    Moderator
  • Not at this time based on this screen shot. http://content.screencast.com/users/bradlaw/folders/Jing/media/b34f7d80-9747-4111-a2ab-6c8cf8d1a3f5/2009-09-18_1318.png

    At one time I did have a plugin to hide a few annoying "sales" system views but it was not working so I removed it until I can find a more stable plugin. Here is what my plugin list looks like using the plugin registration tool. 

    When I am not using the specific ccode above it seems to work fine, I am offically confused. Thanks.


    Friday, September 18, 2009 5:31 PM
  • Any suggestions here?
    Tuesday, September 22, 2009 3:22 PM