I have an advanced form and in one of the advanced form steps, I have a subrid which allows me to add / edit child records. The subgrid opens a basic form.In this basic form I have some javascript. I also want to refer a javascript libarary (attached as a web-file), and it's functions in this basic form. However, I don't know what's the correct syntex to refer to this library. I tried adding it as
Can't remember if doing it in the Page works or not, but worst case you can dynamically write it via JQuery in the provided JavaScript section
var script = document.createElement('script');
script.src='/yourfile.js';
script.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(script);
You can also probably embed a dataverse Web Resource (that contains the script src tag.) on the entity/basic form
Edit: if script src is in the Web Page content then think it may actually be a scope thing, if inside a document ready try accessing the function using parent.parent.yourfunctionname (or if not in doc ready this.parent.parent.yourfunctioname)
Hi @OliverRodrigues , I have added it to the web page related to the advanced form, but when I try to call the function from the basic form (modal form on the subgrid of the advanced form), I get an error:
Uncaught ReferenceError: CBR is not defined
I am calling the function like this:
Hi, how common are these "commongunctions.js"?
if they are common throughout all your Advanced Form, I would add this reference to the Web Page related to the Adv Form
if they are even more high level than that, and would be used your entire Site, I would say to reference in the Content Snippet Tracking Code
stampcoin
11
Muzammil Nawaz
8
Ajlan
6