yuuvis® RAD Q&A

0 votes
by (230 points)

I have a DMS object with user ID field and string field. Using form scripting I am trying to set onChange handler for both fields.
When I change strdocumentname(String) field handler works fine and alert box shows on every change.
But this does not work on idowneruser(ID) field.

Here is my form script


scope.model.idowneruser = scope.api.session.getUser();
//idowneruser is a ID type field
scope.model.idowneruser.onchange = idfieldhandler;
//strdocumentname is a string type field
scope.model.strdocumentname.onchange = textfieldhandler;

function idfieldhandler() {

alert("id field changed");

}

function textfieldhandler() {

alert("text field changed");

}


How to properly set onChange handler on user Id field?

I am currently using version 3.36

1 Answer

+2 votes
by (2.0k points)

You're changing the field "idowneruser" from an ID field to a user object in your first line of code.

It should be

scope.model.idowneruser.value = scope.api.session.getUser().name;

The rest of the script should work fine with that change.

Related questions

0 votes
1 answer
asked Aug 27, 2020 by Mathias Keller (1.8k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
...