Triggers: Prevent sold causes blank Stage option

Hi,

Scenario:
In a certiain sale type, the users are not allowed to set the sale to Sold.

#setLanguageLevel 3;

EventData ed = getEventData();
String SaleType = ed.getInputValue("SaleEntity.SaleType.Id");
String Status = ed.getInputValue("SaleStatus");
if(SaleType == "2" && Status == "2")
{
  ed.setValidationMessage("Please change the Sale Type before setting the sale to Sold");
}

The script prevents it, but when changing to another STAGE, the stage field becomes blank on save.
This occours both in 8.5 as well as latest online

I will report this as a bugg, but, do anyone have any workaround how to solved the issue?

Regards
Pär Pettersson

RE: Triggers: Prevent sold causes blank Stage option

Hi Pär, it's this bug, yes?

https://community.superoffice.com/en/product-releases/bugs-wishes/product-issue/?bid=75051

Af: Frode Lillerud 17. nov 2020

RE: Triggers: Prevent sold causes blank Stage option

Thats the one!

Thanks

Af: Pär Pettersson 17. nov 2020

RE: Triggers: Prevent sold causes blank Stage option

Feel free to add more info to that bug report. I think perhaps SuperOffice has had issues trying to reproduce it.

Af: Frode Lillerud 17. nov 2020