You need to sign in to do that
Don't have an account?
BoolsEye
Set custom currency field to null does not work
I tried to set a custom currency (double) field to null using the AJAX toolkit (beta 3.3) but it does not work.
The field is in the fieldsToNull array of the DynaBean and nillable is true but it is ignored during saving. The value stays the same.
Setting my value to 0 works, so saving is fine.
Is it not possible to set a currency field to null using the toolkit ?
Thanks,
// Juergen
This may be a bug, I'll check and see if it is.
Hi BoolsEye,
Not a bug. Although I don't like the way it works. What you need to do, is when you have an object that you need to set the fieldsToNull on, you can't reuse the object for update. You need to create a new Dynabean for the object to be updated, set the fieldsToNull and set only the other fields that you need to have updated.
Code:
Message Edited by DevAngel on 07-25-2006 09:11 AM
Ok, thank you.
// Juergen
I *have* found that if you take an existing Dynabean, set the fieldsToNull to include specified field and do an update, it will NOT set the field to null.
However if you ALSO set the value of the field to null, it will.
So, I use:
Code:
But, if I were to get rid of the line: this.set(propName,null); it would not work.
Personally, I don't understand why the .set() function in the Ajax toolkit doesn't just do what I've defined above. It's so clearly what we all want and expect it to do.
Thanks, Steve Bower.