How can I set a NULL value with window.handleItemChange?

Hi,

I am pretty sure this one is easy to solve, but I weren´t able to find a solution yet.

I have a Form with a regular standard button. When I click the button, Field values from a previous Item generation shall be mirrored into the current Form. Mirrowing regular values works fine, but I struggle to write NULL values into my form fields.

Here´s the sample of the code I use at the moment:

var previousValue = previousItem.getProperty("document_id");
if (typeof(previousValue ) !== "undefined" && previousValue !== null)
{
    window.handleItemChange("document_id", previousValue); // updates field to new value -> works
}
else
{
   window.handleItemChange("document_id", null); // <- update field to NULL -> doesn´t work
}

I tried this variant, but the database value will be an empty string and not a real NULL:

var previousValue = previousItem.getProperty("document_id",""); // <- database value will not be NULL!
window.handleItemChange("name", previousValue);

 

Thanks for any input!