Skip to main content

Notifications

Microsoft Dynamics CRM forum
Answered

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

Categories:
  • 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,050 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,406 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,406 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,406 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,050 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

Helpful resources

Quick Links

Take the Community feedback survey!

Answer this brief 15-question survey about your Community experience…

Demystifying Copilot: Service Edition with Sundar Raghavan

Sundar answers more questions about Copilot for Service...

Dynamics 365 Business Central vs Finance and SCM

Take a look at the key differences between Business Central and…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,377 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 223,308 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans