Getting error "Cannot read property "t" from undefined" while transferring variable from client controller to server script in widget

Community Alums
Not applicable

Hi All,

I am working with widget, while transferring data from client controller to server script, I am getting error.

Server JavaScript error Cannot read property "t" from undefined

Client controller:

c.closemodel = function() {
c.data.t=c.note;
c.server.update();
alert("Your notes are saved");
}

Server Script:

gs.setProperty("notes",input.t,"description");

5 REPLIES 5

Anil Lande
Kilo Patron

Hi,

Can you please share complete code in Server server script where you are using input.t?

 

Thanks,
Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Community Alums
Not applicable

Hi,

I am writing this line inside the function .

(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
gs.setProperty("notes",input.t,"description");
})();

you have to use it like below:

(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
if(input){
gs.setProperty("notes",input.t,"description");
}
})();

 

Thanks,

Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Community Alums
Not applicable

Thanks Anil...now it is working.