Hello everyone.
I need to create html button on some form of 'contact' entity and add to it some logic. Also I need separate all my JS from html. First things first I created html web-resource with this code:
Hello everyone.
I need to create html button on some form of 'contact' entity and add to it some logic. Also I need separate all my JS from html. First things first I created html web-resource with this code:
Hi EaredGen,
Have you managed to add javascript reference in HTML webresource?
Hi EaredGen,
1. Javascript webresource path reference in HTML is depends on both HTML and javascript webresource path names. This should always be a relative path, if you have maintained a folder structure while creating the webresources.
For example,
If your javascript webresource name is: new_MyJSWebresource and HTML webresource name is: new_MyHTMLWebresource then, your script source in HTML should be: <script src="new_MyJSWebresource"></script>
If your javascript webresource name is: new_MyJSWebresource.js and HTML webresource name is: new_MyHTMLWebresource then, your script source in HTML should be: <script src="new_MyJSWebresource.js"></script>
If your javascript webresource name is: new_/Scripts/new_MyJSWebresource.js and HTML webresource name is: new_MyHTMLWebresource then, your script source in HTML should be: <script src="new_/Scripts/MyJSWebresource.js"></script>
If your javascript webresource name is: new_/Scripts/new_MyJSWebresource.js and HTML webresource name is: new_/Webpages/MyHTMLWebresource then, your script source in HTML should be: <script src="../Scripts/MyJSWebresource.js"></script>
2. Calling method should be a complete name including namespace. In your case, it should be: DA.CRM.Contact.FormScripts.some()
I noticed one syntax error in your javascript code. There is a missing closing brace "}" for some: function. Fix this syntax error and try again, this could resolve your issue.
André Arnaud de Cal...
293,274
Super User 2025 Season 1
Martin Dráb
231,947
Most Valuable Professional
nmaenpaa
101,156
Moderator