Delete-button missing in custom screens

Hi,

We noticed in customer's system that custom "Edit ticket"-screen didn't have Delete-button anymore. Is this intended and should we add it ourselves if customer wants that functionality?

RE: Delete-button missing in custom screens

Hi Mikko,

In custom screens you can choose to include or remove whatever functionality that suits your need.

The delete button has not been removed by default, so I would recommend that you ask the customer if they want the functionality enabled. And as it is only available for administrators (by default) I would recommend adding it again.

In the form page of the screen, this is the code:

HtmlElement formPage = addHtmlElement(getScreenElementId(screenElementIndex),
  getScreenElementName(screenElementIndex),
  getScreenElementType(screenElementIndex),
  getScreenElementConfig(screenElementIndex));

if (ticketId > 0 &&
    ticket.getValue("status") != "4" &&
    getActiveUser().isAdministrator() &&
    getCgiVariable("actionType").toInteger() == 2)
{
  formPage.setFieldValue("addButton", Map().insert("name", "delete").insert("label", getLanguageVariable("delete")).insert("warning", getLanguageVariable("sureDelete")).insert("style", "red"));
}
By: Simen Mostuen Iversen 15 Dec 2020

RE: Delete-button missing in custom screens

Thanks for script! We'll try that with customer's system.

By: Mikko Tillikainen 16 Dec 2020