locked
new line in InvalidPluginExecutionException RRS feed

  • Question

  • are there really no way to add a new line in InvalidPluginExecutionException("aaa"+"\r\n"+"bbb")?

    i want to have error message displayed as :

    aaa

    bbb

     

     

    thanks

    Tuesday, October 12, 2010 9:40 AM

Answers

  • NOTE: Take necessary backup before implementing this UNSUPPORTED solution.

    1. Navigate to file /CRMWeb/_common/error/dlg_error.aspx
    2. In order to make the dialog support HTML messages add the following function that transforms the ErrorMessage Text to HTML. Also added an onload event in the html body tag.

    function unsupported()
    {
    var ErrorMessage = document.getElementById("ErrorMessage");  ErrorMessage.innerHTML = ErrorMessage.innerText;
    }

    <body onload="unsupported()">

    3. Save and close the file.


    Plugin Code:

    namespace HtmlPluginException
    {
        public class PluginException:IPlugin
        {
            public void Execute(IPluginExecutionContext context)
            {
                throw new InvalidPluginExecutionException("First Line <BR> New Line");
            }
        }
    }

    Regards
    Vinoth
     

    Tuesday, October 12, 2010 10:30 AM

All replies

  • This is possible in Unsupported way.

    You can return a interactive html plugin message. Refer here for the article. 

    Tuesday, October 12, 2010 9:49 AM
  • Hi Vinoth,

      i cannot open the link, can you paste the content here, thanks a lot.

    Lander

    Tuesday, October 12, 2010 10:09 AM
  • NOTE: Take necessary backup before implementing this UNSUPPORTED solution.

    1. Navigate to file /CRMWeb/_common/error/dlg_error.aspx
    2. In order to make the dialog support HTML messages add the following function that transforms the ErrorMessage Text to HTML. Also added an onload event in the html body tag.

    function unsupported()
    {
    var ErrorMessage = document.getElementById("ErrorMessage");  ErrorMessage.innerHTML = ErrorMessage.innerText;
    }

    <body onload="unsupported()">

    3. Save and close the file.


    Plugin Code:

    namespace HtmlPluginException
    {
        public class PluginException:IPlugin
        {
            public void Execute(IPluginExecutionContext context)
            {
                throw new InvalidPluginExecutionException("First Line <BR> New Line");
            }
        }
    }

    Regards
    Vinoth
     

    Tuesday, October 12, 2010 10:30 AM
  • Hi Vinoth,

       very thanks for your help, with this unsupported way, i have done it, thanks a lot for your help. i hope i can join your email and make a friend.

    my email is: zyjzhuyongjian@hotmail.com also it's my msn:)

     

    Lander

    Tuesday, October 12, 2010 10:56 AM