The line with the derived klantnm works fine in application, but gives an error in command and in update.
The auto increment doesn’t work either, I still have to give in a number
what would be the correct syntax?
'Aanvrager': stategroup (
'Relatie' {
'KlantNr': text -> ^ ^ .'Relaties'[] where 'RelatieType' -> $ .'RelatieType'?'Debiteur'
'KlantNm': text = >'KlantNr'.'Naam'
}
'Prospect' {
'klantNr': text = "0"
'klantNm': text
}
)
'Nieuwe Calculatie': command {
'calculatie': text @default: auto-increment
'naam aanvrager': stategroup (
'klant' {
'klantnr': text -> .'Relaties'[] where 'RelatieType' -> $ .'RelatieType'?'Debiteur'
// 'klantnm': text = $ >'klantnr'.'Naam'
}
'prospect' {
'klantNr': text //= "0"
'klantNm': text
}
)
'Aanvrager' = switch @ .'naam aanvrager' (
|'klant' as $ => create 'Relatie' (
'KlantNr' = $ .'klantnr'
// 'KlantNm' = >'KlantNr'.'klantnm'
)
|'prospect' as $ => create 'Prospect' (
'klantNm' = $ .'klantNm'
)
)