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.