global relation issue in startup

I have a global relationship called sysadmin (globals.relation (value = 1) :: relation (value = 1))
Which is a relation to one record of settings table.

I am using this relation in the startup method of the solution. Strangely some times I get errors like (sysadmin not defined). But It does not happen all the time. I does happen in client and developer.

Please help!

We are unable to reproduce this, could you please create a support case at: http://crm.servoy.com/servoy-webclient/ … oy_support

Please supply a small test solution that shows the problem

I cannot reproduce it as well at will.

Next time when it occurs I will make a screen shot of it and send it you.

Thanks for your attention.

Hi Hameed,

how are you setting the global?

are you setting the global as a default value?
are you setting it in startup method?

Because if the global is not there, and you want to do something trough the relation, withou checking the relation, you will get an error.

This is a long time existing problem that I used to have frequently (it did get better with 2.2).

The error we get is always a

ReferenceError: relation xy is not defined

Sometimes this happens after a while of user action (so in the middle of a session). It always happens when we export a solution without having opened it first (after you opened it once, it works).

In our case this happens only with

  1. global relations
  2. that are defined in a module

Patrick

Hi Harjo,

I am setting the global value as default and also set in the startup method before using the relation.

Thanks

If I’m right we had those issue too (a long time ago) when accessing data in the startup method of Servoy.

In the start-up method, we only do GUI stuff now. As soon it is related to data, we do it in the onShow of the first form!

From that day on, we never had any problems anymore.

I tend to agree with Harjo.
In the past these issues were known (like Patrick describes).
They are history now.