• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

CRM 2011 Add a MsgBox to replace an Error Message

I have an error message that pops up when a user tries to add more characters to a description field than the limit allows.  The error is:

If I click Download Log File and read the error, it states:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Generic SQL error.Detail: 
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
  <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>Generic SQL error.</Message>
  <InnerFault i:nil="true" />

[b] <TraceText>
[Nextgen.Crm.Plugin: Nextgen.Crm.Plugin.ProcessProjectionFromLineItem]
[4ecac274-ebad-e311-8c19-463500000031: Nextgen.Plugin.ProcessProjectionFromLineItem: Update of opportunityproduct]

Open in new window

How do I read the error specifically  [Nextgen.Plugin.ProcessProjectionFromLineItem: Update of opportunityproduct] and return a MsgBox that states: The description field is limited to 2000 characters

Also I would like to provide the user with an OK button on the MsgBox that puts them back in the Description field

  • 3
1 Solution
Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:

I would suggest you write a JS function which fires on OnChange event. Checks the length of the field and if the length is more than 2000 characters, trim it to 2000 characters.

http://www.w3schools.com/jsref/jsref_substring.asp (change the parameters to 0 and 1999)
apollo7Author Commented:
Thanks, I will give this a try.
apollo7Author Commented:
This works, thanks.
apollo7Author Commented:
This worked, thanks for the help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now