Update 6.0 to 6.1: Cannot convert GlobalScope error...

Hi!
I just tried to upgrade an existing solution to Servoy 6.1.2:
When I start the smart client and try to create a new record the following error occurs:

Cannot convert GlobalScope[Newentry] to java.lang.Integer (./globals.js#152)

Anyone an idea what I’m doing wrong?

Cheers,

Jay

You are upgrading Servoy developer, correct?
What steps did you take exactly?
6.1.2 should be installed in a separate folder. Do you just point to an existing workspace or did you import the solution?

What code is on line 152 of your globals.js?

Hi Joas,

You are upgrading Servoy developer, correct?
that’s correct

What steps did you take exactly?
I did a clean install (exported the solution from 6.0, uninstalled 6.0, deleted workspace directory, installed 6.1.2., imported the solution again)

What code is on line 152 of your globals.js?
forms.Main_application.controller.newRecord(this);

Hope this did help,

Cheers,

Jay

jay.cee:
forms.Main_application.controller.newRecord(this);

The “this” is the problem here, you should remove it.

The newRecord function will create a record at the first position of the foundset when passing no argument.
But you can also pass an Integer, then it will create the new record at that position.
The “this” keyword is a reference to the scope you are in, hence the error that it tries to convert the GlobalScope to an Integer.

I’m not sure how this could have worked in 6.0, but apparently 6.1 is a little more correct on this.

Hi Joas!
Thanks a lot for your help - this of course fixed it for me :)

Cheers,

Jay