SetClientVar and ew.ajax()

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

SetClientVar and ew.ajax()

Post by alliance8791 »

Hi all, i have a StartupScript that, according to a certain value in the DB, retrieved from a date, create a sort of progressive date/number. Ex: 260419-00x
It worked until version phpmaker 2017, i tried version 2019 and it is not working anymore.

This is what i had:

On server events --> Page_load:
function Page_Load() {
SetClientVar("querySql", Encrypt("SELECT value FROM gest_progr WHERE valueName = '{query_value}'"));
}

On CLient Scripts i had:
$('#x_data').change(function(){
$('#x_nProtocollo').css("background-color","#db1c03").css("color","#ffffff").css("font-size","16px").css("font-weight","800");
$valoreData = $('#x_data').val();
$valoreData = $valoreData.split('/');
$valoreData = $valoreData[2] + '-' + $valoreData[1] + '-' + $valoreData[0];
// CERCA SE C'E' UNA DATA CON UN PROGRESSIVO
--> var result = ew.ajax(ewVar.querySql, $valoreData);
.
.
.

Now when i set a date in the datepicker, the Chrome console reports: Uncaught ReferenceError: querySql is not defined

What can i do ?
Tnx in advance


arbei
User
Posts: 9384

Post by arbei »

In v2019 there is API, you don't need to provide the SQL by server event any more, see the topic Lookup Table > Ajax by API and Client Scripts > Example 1 in the help file.


alliance8791
User
Posts: 49

Post by alliance8791 »

Thank you very much. I solved!


Post Reply