JavaScript Error with Custom Template in Add/Edit Page

Got this error sinds a time in V2021ew.js:4525 Uncaught TypeError: Cannot read property ‘content’ of null
at Object.applyTemplate (ew.js:4525)
at 5675?showmaster=orders&fk_id=2172:1803
at i (ewcore.js:4537)
at ewcore.js:4696
at Array.o (ewcore.js:4488)
at o (ewcore.js:4521)
at ewcore.js:4680
at r (ewcore.js:4636)
at HTMLScriptElement.u.onload.u.onerror.u.onbeforeload (ewcore.js:4606)Is there a way to find out what is causing this?Any help is welcomeRegards,Aren

It seems that you are using Custom Template for the Master Record Page. If not, you may check the Custom Template and press “Clear” to make sure there is no custom template and hence the error (which means a custom template is not found).

The strange thing is there is no Custom Template Master Record page at all. I cleared it to be sure but no change.
I have however a CustomTemplate for the Edit- and Add page.The loading indicator keeps running and all the select boxes are empty because of this error.
This is the error(indicated with <----) in javascript when I follow the error from the console when I open the Edit or Add page.Does it make sense to you what it means?Regards,Aren

It seems that you have set up Multi-Page for the table. If so, please be reminded that your Custom Template must have the same pages also using {{{page_n}}}…{{{/page_n}}}.

Yes I had this:


{{{page_1}}}

{{{/page_1}}}{{{page_2}}}

{{{/page_2}}}{{{page_3}}}

{{{/page_3}}}{{{page_4}}}

{{{/page_4}}}{{{page_5}}}

{{{/page_5}}}{{{page_6}}}

{{{/page_6}}}{{{page_7}}}

{{/page_7}}}

When I changed it to this the problem is solved. (Without de container div around it and without the empty lines between the page breaks.){{{page_1}}} .... {{{/page_1}}} {{{page_2}}} ... {{{/page_2}}} {{{page_3}}} ..... {{{/page_3}}} {{{page_4}}} .... {{{/page_4}}} {{{page_5}}} .... {{{/page_5}}} {{{page_6}}} .... {{{/page_6}}} {{{page_7}}} ... {{/page_7}}}The area outside the page elements seems to expect another template/page.ew.applyTemplate("tpd_orderarticlesedit", "tpm_orderarticlesedit", "orderarticlesedit", "", ew.templateData.rows[0]); <----- because this line give the error and is not related to a page.

Dadinos2 wrote:

{{/page_7}}}


  1. Missing a {.
  2. If your Custom Template is not well-formed, it might be parsed and outputted incorrectly, then the browser cannot render outputted code correctly and therefore the div with the specified id (e.g. “tpm_orderarticlesedit”) cannot be found, and hence the error.