Dynamically set value of a form field not inserted into database

hello,

in a form I have a form-field whose value gets set dynamically via a macro. So far, so good. That works. But then, when I want to store the content of my form in my database I get an error (depending on the settings for the form-field it’s either an sql-error like “attempt to insert null in a non-nullable column” or “Error writing to database”). Obviously values inserted into the form with a macro like in the following snippet are not valid:

oDrawPage.getByName("fmtinvoice_num").text = reNum 're_num is an integer value

Why is that? Resp. what can I to do to make the dynamically entered value being recognized?

Thanks very much for help

[solved] replacing ‘text’ with ‘effectiveValue’ and comitting afterwards seems to do the trick:

oDrawPage.getByName("fmtinvoice_num").effectiveValue = reNum
oDrawPage.getByName("fmtinvoice_num").commit(reNum)