I am having problem with the onRender event in webclient.
function onRender(event) {
// TODO Auto-generated method stub
/** @type {JSRecorddb:/database_name/stock_items} */
var myRecordStock = event.getRecord();
var myStock = myRecordStock.stockcode;
I’ve placed the above onRender function in a text field on table view. When I run it in smart client, it works properly. However, when I run it in webclient, I got the following error message:
TypeError: Cannot read property “stockcode” from (F:\Servoy Projects\TestWebStuff\forms\commitlist.js#37)
at F:\Servoy Projects\TestWebStuff\forms\commitlist.js:37 (onRender)
Is it supposed to work only in smart client but not webclient?
Yes, Harjo you are correct and the code snippet you have given will work. I have faced same issue and get ride of that by checking if record is exist before accessing the data.
It is still not working. I have the feeling that “event.getRecord()” does not work in webclient. When I go to debug, the value generated by “event.getRecord()” is “Record”. However, when I debug in webclient, the value generated is “null”.
Can anyone please confirm that “event.getRecord()” does not work in webclient but runs beautifully in smart client?