Action does not work as intended

When a New article is added, the leverancierNr is accepted but the artikellijsten page shows up with an Empty leverancierNr.
In addition, the artikellijst does not show the concat but only the artikelNr.
The artikelNr as well as the prijs however show the correct inputs.
What do I overlook?

	'ArtikelLijsten': collection ['ArtikelLijst'] {
		'LeverancierNr': text -> ^ .'Relaties'[] where 'Crediteur' -> $ .'Crediteur'?'ja'
		'ArtikelNr': text
		'prijs': number 'euro'
		'ArtikelLijst': text @default: concat ( >'LeverancierNr'.'RelatieNr', .'ArtikelNr' )
  }
	'ArtikelLijst toevoegen': action {
		'LeverancierNr': text -> .'Relaties'[] .'Crediteur'?'ja'
		'ArtikelNr': text
		'prijs': number 'euro'
 	}	=> update .'ArtikelLijsten' = create (
		'ArtikelNr' = @ .'ArtikelNr'
		'prijs' = @ .'prijs'
    )

Hi Anton,

First of all a question: why do you write an action for this? The action does nothing more than the usual create action that the auto-generated client already supports.

Then, if you still want to use this action, there is one thing to note in your implementation: you do not set the LeverancierNr in your action implementation

This probably combines with two other things to lead to the results you are seeing:

  • There probably is a Leverancier with an emtpy ("") LeverancierNr OR there is only one leverancier
  • you did not specify = create show interactive ( in the action implementation. The ‘show’ says: show the resulting entry and interactive says: show the create screen, even when all properties are valid, so the user can interact with the data before actually creating it. Both these modifiers can be set independently.

You should also be aware that if the reason you are using this action, is to be able to use it from a different context than the parent context of the collection, you could suffice with the following:

'ArtikelLijst toevoegen': action {
 	}	=> update .'ArtikelLijsten' = create show interactive ( )

Thanks for the answer, although I was on a side track, the answer still helped.