cancel
Showing results for 
Search instead for 
Did you mean: 

declare varible in initialize -> not in exit ?

Former Member
0 Kudos

HI Community,

I just declared a variable in the initialize event of one of my fields in my subform.

var help = "1";

Now I want to use this help variable in my exit event of the same field.

But it doesn't work out?

greets

Chris

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Chris,

If you declare a variable in any of the events, its scope it limited in that event only. You cannot access it in other events.

If you want to use a variable across events, you have to create seperate script objects and declare the variables.

1) Right click your main form / subform

2) Click 'Insert Script Object'

3) Script Objects gets created in the Hierarchy view under variables

4) Give a new name and you can declare the global variables in it

If you declare a variable like var help = "1"; in the script object, it can be accessed by following the path.

subform.variables.scriptobjectName.help

Hope this will help.

Thanks & Regards,

Sanoosh

Former Member
0 Kudos

Thanks a lot Sanoosh,

I just want to achieve that one of my array should only be loaded one time.

Any idea how i can fix my problem?

thanks a lot

Chris

Former Member
0 Kudos

Hi Chris,

Hope your previous problem got solved.

To make sure that the array loads only once, put the script in the event which triggers only once.

Thanks & Regards,

Sanoosh