Answered by:
CrmScriptErrorReport

Question
-
i m getting the following error report when i try to save new lead in my ms crm 4.0.
plz suggest me any solution or weblinks to solve this error.
solutions, comments and suggestions are welcomed.
Microsoft Dynamics CRM Error Report Contents
<CrmScriptErrorReport>
<ReportVersion>1.0</ReportVersion>
<ScriptErrorDetails>
<Message>Unterminated string constant</Message>
<Line>166</Line>
<URL>/SynovergeTech/_forms/FormScript.js.aspx?etc=4&FormType=main&FormName=crmForm</URL>
<PageURL>/SynovergeTech/sfa/leads/edit.aspx</PageURL>
<Function></Function>
<CallStack>
</CallStack>
</ScriptErrorDetails>
<ClientInformation>
<BrowserUserAgent>Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E)</BrowserUserAgent>
<BrowserLanguage>en-us</BrowserLanguage>
<SystemLanguage>en-in</SystemLanguage>
<UserLanguage>en-in</UserLanguage>
<ScreenResolution>1366x768</ScreenResolution>
<ClientName>Web</ClientName>
</ClientInformation>
<ServerInformation>
<OrgLanguage>1033</OrgLanguage>
<OrgCulture>1033</OrgCulture>
<UserLanguage>1033</UserLanguage>
<UserCulture>1033</UserCulture>
<OrgID>{6CFC7BB1-011B-44CC-A5E5-4A7FD8BE6E87}</OrgID>
<UserID>{7B33B6CD-952C-E111-A5E3-005056C00008}</UserID>
<CRMVersion>4.0.7333.2149</CRMVersion>
</ServerInformation>
</CrmScriptErrorReport>
Tuesday, January 3, 2012 7:31 AM
Answers
-
You're missing brackets for your if statement. JS requires brackets, unlike other more recent C++-like OOP languages (notably C#).
if(crmForm.all.telephone1.value.search(e) == -1) { alert('number should be proper'); }
Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com Please follow the forum guidelines when inquiring of the dedicated CRM community for assistance.- Marked as answer by Amit Kasundra Tuesday, January 3, 2012 9:03 AM
Tuesday, January 3, 2012 8:16 AMModerator
All replies
-
i dont get this error report when i try to save any other entity..
just it occurs only in lead and my validations using javascript on fields like business phone or on any other field of lead is not working..
it is also happening only in lead creation not in case of any other entity.
Tuesday, January 3, 2012 7:36 AM -
Do you have any script in the OnLoad or OnSave events of the Form in the Leads entity?
If so there might be a problem there, could you please post the javascript code you are using there?
Regards,
Damian SinayTuesday, January 3, 2012 7:41 AM -
Hi Amit,
Are there any kind of plugins or workflows for lead entity that you happen to create.
Regards,
JP
Tuesday, January 3, 2012 7:47 AM -
Sounds like an OnSave event custom script that has a string without a finishing quote/double-quote at the end... so the JS interpreter doesn't know where the end of the string is.
Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com Please follow the forum guidelines when inquiring of the dedicated CRM community for assistance.Tuesday, January 3, 2012 7:57 AMModerator -
i dont hve any script in OnLoad or OnSave events.
i get the earlier error report with following message.
Microsoft Dynamics CRM has encountered an error. Please tell Microsoft about this problem.
View the data that will be sent to Microsoft.
my javascript code is as below
var e = /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$/;
if(crmForm.all.telephone1.value.search(e) == -1)
alert('number should be proper');Tuesday, January 3, 2012 8:02 AM -
Do you have a script in the onChange event of the telephone1 field?
Regards,
Damian SinayTuesday, January 3, 2012 8:10 AM -
You're missing brackets for your if statement. JS requires brackets, unlike other more recent C++-like OOP languages (notably C#).
if(crmForm.all.telephone1.value.search(e) == -1) { alert('number should be proper'); }
Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com Please follow the forum guidelines when inquiring of the dedicated CRM community for assistance.- Marked as answer by Amit Kasundra Tuesday, January 3, 2012 9:03 AM
Tuesday, January 3, 2012 8:16 AMModerator -
Thanx DavidBerry,
it was a silly mistake.
now it is working perfectly.
thanx for giving me solutions JP n Damian..
Tuesday, January 3, 2012 9:10 AM