Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Portal comment error when using the < and the > symbols

Posted on by 1,806 Most Valuable Professional

When adding a portal comment via a Microsoft Portal, users are getting an error when adding text that is precedded with a < and ends with an >. So for example, you might paste in information with someone's email address like this:

Megan Walker <hello@meganvwalker.com> 

When saving, the following error occurs:

1563.portal-comment-error.PNG

Any ideas how to allow this kind of comment to go through with the characters? 

*This post is locked for comments

  • Suggested answer
    Adam Pfau Profile Picture
    Adam Pfau 265 on at
    RE: Portal comment error when using the < and the > symbols

    I know this is older but wanted to add the setting that allows this.  Keep in mind that you are disabling some security by allowing these symbols in the comments.

    Create a site setting call DisableValidationWebTemplate and set this to True.  But default this setting is False but you wont see it unless you add it.  

  • Suggested answer
    Arpit Shrivastava Profile Picture
    Arpit Shrivastava 7,518 User Group Leader on at
    RE: Portal comment error when using the < and the > symbols

    Hi Megan,

    I had also observed this in multiline text fields on Entity Form. Seems a bug in Dynamics 365 Portal. It does not allow angular brackets. We are managing it by removing the angle brackets '< >' on onpaste and onkeypress events

    Here is the code you can take help to get rid of this 

    $(window).load(function(){

    // Remove default onpaste event of textarea
    $("#id").removeAttr("onpaste");

    // OnKeypress Event
    $('#id').keypress(function(event) {
    if (event.keyCode == 60 || event.keyCode == 62) {
    alert("You are not allowed to enter Angle brackets");
    return false;
    }
    });

    // Onpaste Event

    $("#id").bind('paste',function()
    {
    setTimeout(function()
    {
    //get the value of the input text
    var data= $('#id').val() ;
    //replace the <> to ''
    var dataFull = data.replace(/[<>]/g, '');
    //set the new value of the input text without special characters
    $('#id').val(dataFull);
    });

    });
    });

    Hope it helps.


    If found useful, please mark the answer as verified.


    Cheers
    Arpit
    https://arpitmscrmhunt.blogspot.com

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans