Skip to main content

Task

If you create a new CarReservation, the current date should be preselected as start date, but still it should be possible to overwrite this date with another arbitrary date. If you edit an existing CarReservation, the start date should not be overwritten by the current date.

tip

Here you can find information about preselections.


Solution

Enter the following valueProcess in CarReservation_entity's field STARTDATE:

import { datetime, neon, result, vars } from "@aditosoftware/jdito-types";

if(vars.get("$this.value") == null && neon.OPERATINGSTATE_NEW == vars.get("$sys.recordstate"))
{
result.string(datetime.date());
}

CarReservation_entity.STARTDATE.valueProcess