Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Portal Entity Form - Custom Javascript size exceeded

Posted on by 115

Custom JavaScript exceeded the maximum number of 1 Lakh characters in Portal Entity Form. 

I found the below two as solutions to overcome this, but I need a suggestion to follow the best approach. 

  1. Increase the maximum length of the field ‘Custom JavaScript’ in the entity ‘Entity Form’

(Note: I tried increasing the maximum length in trail instance and it is working fine as expected. As it is a trail instance, unable to do impact analysis).        Reference URL : http://sharathdozen.blogspot.com/2017/11/increasing-maximum-character-limit-for.html

2.  Adding Custom Scripts in the associated web page of the entity form.

Please suggest.

Thanks & Regards,

Nandhini M

*This post is locked for comments

  • lgretz Profile Picture
    lgretz 20 on at
    RE: Portal Entity Form - Custom Javascript size exceeded

    Hi there, this looks like the exact answer I need. I'm very new to portals and tried a few tutorials to add javascript in this way however, its not working.

    Could you send instructions or a link to instructions for this? Thanks!

  • Suggested answer
    oliver.rodrigues Profile Picture
    oliver.rodrigues 4,052 on at
    RE: Portal Entity Form - Custom Javascript size exceeded

    I don't like enabling JavaScript upload in CRM.. specially if your Portal allow users to upload files

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Portal Entity Form - Custom Javascript size exceeded

    I too think James suggestion is better and clean :)

  • Nandhini Profile Picture
    Nandhini 115 on at
    RE: Portal Entity Form - Custom Javascript size exceeded

    Hi Ravi,

    Thanks for the approach.

    I agreed with James suggestion as this could be a best approach in terms of security perceptive.

    Thanks & Regards,

    Nandhini M

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Portal Entity Form - Custom Javascript size exceeded

    Hi Nandhini,

    How did you get on with this? If you have got the answer to your questions then please close the thread by marking the suggestion as helpful. This will help other looking for the same/similar issue.

  • Verified answer
    RE: Portal Entity Form - Custom Javascript size exceeded

    Hello Nandhini

    My suggestion is place entire script into one JS file and add it as a web file and refer it in your web template (if you are using web template to render entity form) else you can refer JS file under Header/footer (if you are using header /footer) web template also since it is common across the portal.

    Thanks and Regards

    James

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Portal Entity Form - Custom Javascript size exceeded

    Hi Nandhani,

    I faced the same issue once and overcome it but compressing the JS code using the tools available online https://jscompress.com/. The downside for this is that everytime you made a change on your uncompressed code, you need to compress it again before saving it on entity form.

    Hope this helps.

  • Suggested answer
    oliver.rodrigues Profile Picture
    oliver.rodrigues 4,052 on at
    RE: Portal Entity Form - Custom Javascript size exceeded

    you can increase the field size of the JS field, there is no issue there

    but.. if you are exceeding the maximum you should revisit your JS code

    try creating as much reusable functions as possible

    create a common library and store in the head/bottom or tracking code snippet

    if your "library" is used only in your entity form, create a snippet just for that and call in your entity form

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