setDataProviderValue for globals

Hi, I tried making a generic method to set a default value in a field on a form for when a valuelist is attached to the field. I do this by getting the DataProviderId and then setting the DataProviderID to a certain value.

Because it needs to be generic, everything is based on form[formname].elements[elementname].xxxxx ways of coding.

Now I ran into the case where the DataProviderID is a global field. The getDataProviderID returns “globals.xxxxx”.

When I then do forms[yyyyy].controller.setDateProviderValue(‘globals.xxxxx’, zzzzz) is doesn’t work.

My guess is that the forms[yyyyy].controller.setDateProviderValue doesn’t allow setting the value of a global currently.

Can this be made to work, so it’s more generic?

Paul

Ps: i worked around it by checking of the returned DataProviderID starts with “globals.” and in that case, i set the global using the eval function, but that’s not a neat way of coding, i think and in general, I try to stay away from the eval function.

Anyone?

Am I doin it wrong? Is it not cupported? If not, could it be made to be supported?

Paul

this should work fine:

globals[‘name’] = xxx

setDataproviderValue only works for setting things on the current record. There is not support yet for globals setting through that way.
if you want that make a RFE:

http://crm.servoy.com/servoy-webclient/ … oy_support