Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

CRM 2011 Add a MsgBox  to replace an Error Message

Posted on 2016-07-14
4
143 Views
Last Modified: 2016-07-29
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=5.0.0.0, 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">
  <ErrorCode>-2147204784</ErrorCode>
  <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>Generic SQL error.</Message>
  <Timestamp>2016-06-22T14:23:05.2533638Z</Timestamp>
  <InnerFault i:nil="true" />

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

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

Thanks
0
Comment
Question by:apollo7
  • 3
4 Comments
 
LVL 19

Accepted Solution

by:
Rikin Shah earned 500 total points
ID: 41717102
Hi,

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.

References:
http://www.w3schools.com/jsref/jsref_length_string.asp
http://www.w3schools.com/jsref/jsref_substring.asp (change the parameters to 0 and 1999)
0
 
LVL 1

Author Comment

by:apollo7
ID: 41721157
Thanks, I will give this a try.
0
 
LVL 1

Author Comment

by:apollo7
ID: 41735203
This works, thanks.
0
 
LVL 1

Author Closing Comment

by:apollo7
ID: 41735204
This worked, thanks for the help.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question