This topic is locked

Error field events

1/4/2021 3:29:33 AM
PHPRunner General questions
Tedy author

I use field events but I have a console error

Can anyone help me?

Thanks
Here is the code used
Client Before

var ctrlMATERIAL = ctrl.getPeer('MATERIAL');

var ctrlFURNIZOR = ctrl.getPeer('FURNIZOR');

params["MATERIAL"] = ctrlMATERIAL.getValue();

params["FURNIZOR"] = ctrlFURNIZOR.getValue();


Server

$result['PRET_MATERIAL'] = DBLookup("SELECT PRET FROM gen_materii_prime_pret WHERE MATER_PRIME='".$params["MATERIAL"]."' and DEN_FURNIZOR='".$params["FURNIZOR"]."'");


Client After

var ctlPRET_MATERIAL = ctrl.getPeer('PRET_MATERIAL');

ctlPRET_MATERIAL.setValue(result['PRET_MATERIAL']);


The error in the console is:

Uncaught TypeError: Cannot read property 'PRET_MATERIAL' of undefined

at constructor.after (:8086/include/runnerJS/events/pageevents_client_add_etic_tip.js?8197_1609724437:19)

at Object.success (:8086/include/runnerJS/events/pageevents_client_add_etic_tip.js?8197_1609724437:21)

at j (loadfirst.js:1)

at Object.fireWith [as resolveWith] (loadfirst.js:1)

at x (loadfirst.js:1)

at XMLHttpRequest.b (loadfirst.js:1)


PHPrunner version 10.4 / 36153 / x64

Sergey Kornilov admin 1/4/2021

The first troubleshooting step would be printing the actual SQL query and also running it manually against your database to see if it returns correct results.