Good morning everyone,
I have two tables that contain the same columns used before and after requesting a subscription. The first table is useful to me during the negotiation, because until the subscription contract is signed the data may be subject to change. While the second is useful to me as a snapshot of the data at the time of signing.
Is there the possibility of using a single form to show data from both tables? During submission, the data in the first column will be visible and once the contract has been signed, the data from the moment of signing will be shown.
I hope I was clear
A thousand thanks
Giacomo
can you share a picture of your data model, with the attributes in those entities.
When you say 'no longer can be changed', what attributes are you talking about, only in the subscription table, right ?
So all you need is a distinguishing attribute (something like 'status' or an 'IsSigned' boolean, to know what subscription details can still changes and which can't. And you say a single user can have multiple subscriptions, so there will be a foreign key in subscription to user.
Dorine
Hi,
Basically requirement is you want to bind single form with multiple tables. So one solution may be you can create one data action and in that data action use both the aggregates with conditions and then assign the output of aggregate in one variable and set as output of data action. Now you can use this output in the form or in a local variable.
regards
I believe it's not possible but you can do a workaround by creating a Structure with information of both tables then you create a variable list of this structure and pass it to the form.
Hi @Giacomo Socini ,
it might be worth trying to turn around the way you think about this.
I don't know your exact data and process, but it sounds to me more like you have one single concept, a subscription, that goes through a lifecycle, with different business rules relating to the state it is in, i.e. in the 'proposal' state, details can still be altered, in the 'signed' state not.
I would probably model this as a single entity (= single table) with a status field representing the state it is in, and validations in the wrapper crud actions to make sure details don't get altered after signing.
Hi Dorine,
the user can sign more then one subscription. The user information can be modified in every moment without edit the past subscription.
Thanks
I don't understand why that would mean you need 2 entities
the situation is as follows:
The subscription form is made up of your data. Once signed up for the subscription, the user's data must go into the subscription table so that it can no longer be changed.The user has the ability to see the details of the subscription they signed up for and I wanted to use the same registration form.
Is there any way to do it? Otherwise I have to duplicate the form and do the job twice...
Like @Dorine Boudry said you should use one entity with one extra col like status or state to identify if status is proposal or signed. if its signed then you can disable the form fields so that user will not be able to change the data.
But I dont know the exact requirement so if you still want to use 2 entity approach and bind the column to input field based if subscription is signed or not you can do following things.
1. Create one structure called TempSubscription with all the columns available in entities.
2.On screen Create Data action with output variable of type TempSubscription.
3. In data action check if subscription is signed or not If its signed then assign values from table 1 to output variable or vice versa.
4. Bind the output variable attributes to form on screen.
regards,
Pramod.
Are you managing any flag to identify that contract is signed or not
I mean at what time you are inserting contracted data into table if this logic will be clear for us so we can help you to provide better solution or if possible please mention table attributes as well.
Arun