Page 1 of 1

Custom Template error before data listed in summary report

Posted: Mon Aug 15, 2022 3:57 pm
by mavel

Hi,

I am using the "requires search" feature on the summary report page.

I am calling data with this code in CustomTemplateHeader.

<h1 class="fw-bold">{{: {{{dbvalue {{{Company}}} }}</h1>

Before the summary report data is listed, I get the following error on the advanced search page:

VM10712:5 Uncaught TypeError: Cannot read properties of undefined (reading 'Company')
at Function.eval [as fn] (eval at L (jsrender.min.js:3:21286), <anonymous>:5:40)
at O (jsrender.min.js:3:14368)
at Function.E [as render] (jsrender.min.js:3:13117)
at Object.applyTemplate (ew.min.js:5:86328)
at orders?cmd=search&t=orders&z_TaxNo=%3D&z_TaxNo=&z_CompanyNo=%3D&z_CompanyNo=&btn-submit=:415:8
at o (ewcore.min.js:5:230)
at ewcore.min.js:5:1444
at Array.i (ewcore.min.js:5:1370)
at i (ewcore.min.js:5:130)
at ewcore.min.js:5:1180

After searching and listing data, I don't get any errors.
How can I fix this error that occurred before listing?
Thank you.


Re: About javascript error before data listed in summary report

Posted: Mon Aug 15, 2022 4:15 pm
by mobhar

You may add if condition block in your Custom Templates, so that the code will only be executed after end-users entering the Company data.


Re: About javascript error before data listed in summary report

Posted: Mon Aug 15, 2022 5:47 pm
by arbei

There is no DbValue in header (which is the table header).