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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156