How to make a field dynamic in cuba studio

Hello good people,
in my project I have a textField for phone numbers, I want to make it dynamic such that someone can add as many phone numbers as possible(i.e mobile phone, home phone, work phone e.t.c) e.g by clicking a (+) sign, how can I achieve this? Your advise will be highly appreciated.

hi,

i created an example for you that shows how to model that. Basically you can just create a composition from Customer to TelephoneNumber and use the standard screen generation to add dynamic entries.

You can find the example here:

In the README, there are screenshots showing the resulting screens.

Bye
Mario

2 Likes

Hi,

It seems that the best way is to create a separate entity PhoneNumber and use it as a Composition attribute of your main entity. In this case, your phone numbers will be persistent, and you can create as many of them as you like.
See more on composite structures here.

1 Like

Thank you. I did it and it worked like charm!