Search code examples
tridiontridion2009custom-url

Remove all items in multivalue field from Custom URL page


I have a Custom URL That loads all the fields from a multi value text field for modifying.

When the save button is clicked it should update all the fields but at the moment all it does is add additional parameters rather than update the exisitng ones, how would I delete all the existing values ready to repopulate.

my save function looks like this

function SaveAndClose()
{
    var returnValues = new Array();

    var selectobject=document.getElementById("FeedItem")
    for (var i=0; i<selectobject.length; i++)
    {
        if (selectobject.options[i].value != '')
        {
            returnValues.push(selectobject.options[i].text);
        }
    }
    window.returnValue = returnValues;
    self.close();
}

Solution

  • This is possible with the newer API introduced in SDL Tridion 2011, but I don't think you can do it in 2009.

    From the SDL Tridion 2009 SP1 Content Management Implementation Manual

    (Section 9.15.3, Using a Custom URL to fill in the value of a field)

    Multivalued fields — Should use an array for the returnValue. Each entry in the array represents a value to insert in the field.