web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Portal Entity Form - Custom Javascript size exceeded

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Suggested answer
    oliver.rodrigues Profile Picture
    4,052 on at

    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

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    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.

  • Verified answer
    Emmaneul James Abraham Profile Picture
    727 on at

    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

  • RaviKashyap Profile Picture
    55,410 Moderator on at

    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.

  • Nandhini Profile Picture
    115 on at

    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
    55,410 Moderator on at

    I too think James suggestion is better and clean :)

  • Suggested answer
    oliver.rodrigues Profile Picture
    4,052 on at

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

  • lgretz Profile Picture
    20 on at

    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!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans