The form has RUN :: iFrame.
I added two buttons to it for searching by a range of dates (for the current month and the current year)
It is necessary to select the reflection by month when opening the form.
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE (p_dat LIKE '2021') AND ( (CONVERT(p_dat USING utf8) LIKE "%2021%" OR CONV' at line 3
===SQL===========
SELECT pl_id,p_dat,p_pl,p_dop,p_com,p_dep,p_st
FROM plan
WHERE WHERE (p_dat LIKE '2021') AND ( (CONVERT(p_dat USING utf8) LIKE "%2021%" OR CONVERT(p_pl USING utf8) LIKE "%2021%" OR CONVERT(p_dop USING utf8) LIKE "%2021%" OR CONVERT(p_com USING utf8) LIKE "%2021%" OR CONVERT(p_dep USING utf8) LIKE "%2021%" OR CONVERT(p_st USING utf8) LIKE "%2021%") ) LIMIT 0, 15
if(nuFormType() == 'browse'){
Data = new Date();
year = Data.getFullYear();
month = Data.getMonth();
// day = Data.getDate();
switch (month)
{
case 0: fMonth="январь"; break;
case 1: fMonth="февраль"; break;
case 2: fMonth="март"; break;
case 3: fMonth="апрель"; break;
case 4: fMonth="май"; break;
case 5: fMonth="июнь"; break;
case 6: fMonth="июль"; break;
case 7: fMonth="август"; break;
case 8: fMonth="сентябрь"; break;
case 9: fMonth="октябрь"; break;
case 10: fMonth="ноябрь"; break;
case 11: fMonth="декабрь"; break;
}
let formDate = Data.toISOString();
tmonth=formDate.substr(0,7);
//nuMessage([tmonth]);
nuSetProperty('year_filter',tmonth);
nuAddActionButton('f_month', fMonth, 'nuSearchAction("", tmonth)');
nuAddActionButton('f_year', year, 'nuSearchAction("", year)');
}
This is how button search works. But when opened, the form is empty.
My SQL-code
It doesn't work either.
If we apply nuGetBreadcrumb (0), then the filter is triggered when the form is loaded, but the form is constantly updated. We need to apply nuGetBreadcrumb (0); Just once - how to do it?