Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Nickel Contributor
Posts: 66
Registered: ‎03-30-2009

Error message not the same..??

I have modified the Opporutnity Snapshot form, and trying to throw a validation error when the user clicks on the actual close link if data is incorrect.

 

The check fires correctly, however on my VM Dev Box I get small little SLX Validation error popup with ok button.. PERFECT..!

 

When I moved this same code to the QA server however now rather than the box poping up .. I am getting an entire WebPage error, which contains my error message..?

 

Code issimple

 

throw new Sage.Platform.Application.ValidationException("This is not working correctly.");

 

 

Any ideas why it works correctly one place not another..?

 

 

 

 

Bronze Super Contributor
Posts: 236
Registered: ‎03-30-2009

Re: Error message not the same..??

Rich,

   If you are doing this from a dialog, the surrounding functionality may swallow the error.  This happens with activities.  To show the error, you need to do the following:

 

  • In your OK Button, add a try/catch
  • Remove the 'DialogOK' result from teh button properties.
  • Close the dialog on success using the CloseParentDialog
  • If you encounter an exception, add javascript to show an alert with the exception text.  You can optionally close the dialog at this point.

Here's an example:

 

public void OkButton_Click(object sender, EventArgs e)
{
    // MyEntity contains the entity you are validating
    try
    {
        MyEntity.ValidateEntity(true);
    }
    catch (Exception exc)
    {
        string sBr = "<" + "br " + "/" + ">";
        // Note - we need to replace the standard line breaks with new line chars (\n) for the alert to display properly
        ScriptManager.RegisterStartupScript(OkButton, OkButton.GetType(), "ValidationError", "alert('" + exc.InnerException.Message.Replace(sBr, "\\n") + "');", true);
        return;
    }
    CloseParentDialog(true);
}

 

Mike LaSpina
Professional Services Consultant

Sage
8800 N Gainey Center Dr Ste 200
Scottsdale AZ 85258
Tel: 480-383-5344
Cell: 480-321-6637
Fax: 480-556-4090
mike.laspina@sage.com

Your Business in Mind.
Nickel Contributor
Posts: 66
Registered: ‎03-30-2009

Re: Error message not the same..??

Mike,

 

Thanks for the reply. I am not trying to pop an actual dialog box. If you use the Sage;Saleslogix.Validation it pops just a message box with just an ok on it.

 

Seems the code on one machine fires and works correctly, however on the server is doesn't .. it thorws the error but rather than the small popup I get an entire webpage showing the error, moving browser back goes back to application w/o issue.

 

I'm trying to understand what could be different between the two.

Bronze Super Contributor
Posts: 236
Registered: ‎03-30-2009

Re: Error message not the same..??

Soem ideas (in no particualr order)

  • Clear browser cache
  • Do a full nuke and pave in both places
  • Make sure .net version is the same in both places
  • Make sure web site config is the same in both places

Something is different - the hard part is finding what given all the moving parts.

 

Mike LaSpina
Professional Services Consultant

Sage
8800 N Gainey Center Dr Ste 200
Scottsdale AZ 85258
Tel: 480-383-5344
Cell: 480-321-6637
Fax: 480-556-4090
mike.laspina@sage.com

Your Business in Mind.
Silver Contributor
Posts: 835
Registered: ‎03-24-2009

Re: Error message not the same..??

Tell me you are using the same browser on these machines and logged in as the same non-Admin user?

RJ Samp
Nickel Contributor
Posts: 66
Registered: ‎03-30-2009

Re: Error message not the same..??

Rj, Thanks for the reply..

 

Yeah Both are same browser, same version.. Same user..

 

I checked .net versions -- same

 

Is there configuration in IIS that handles the error messages I am missing..?

Nickel Contributor
Posts: 66
Registered: ‎03-30-2009

Re: Error message not the same..??

Ok noticed this..

 

the one that is working correctly is from wihtin Visual Studio as I am trying to debug.. What is different between the default VS IIS settings/Web site and regual IIS/SLX Settings..?

 

Where can I find the settings for the VS Web Server..?

Highlighted
Bronze Super Contributor
Posts: 236
Registered: ‎03-30-2009

Re: Error message not the same..??

Personal Web server (what you are running in Visual Studio) and IIS are 2 completely different programs.  You need to test using IIS to see what will actually happen in your prod environment. 

 

The alanlogy here is using IE vs FireFox - they are mostly the same, except when they're not.

Mike LaSpina
Professional Services Consultant

Sage
8800 N Gainey Center Dr Ste 200
Scottsdale AZ 85258
Tel: 480-383-5344
Cell: 480-321-6637
Fax: 480-556-4090
mike.laspina@sage.com

Your Business in Mind.