Custom Template error before data listed in summary report

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mavel
User
Posts: 88

Custom Template error before data listed in summary report

Post 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.


mobhar
User
Posts: 11660

Post 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.


arbei
User
Posts: 9292

Post by arbei »

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


Post Reply