Add activity functionality in page

1
I have two entities 1. is user details and another one is activity details. I have taken one data view with an entity path of user details .inside the user detail form i want to add one functionality i.e. related to activity . In this when the user will click on add activity he will be able to add activity. he can add numbers of activity in single form and as soon as he is adding the data t, the heading of activity details will also change . how can i achieve it
asked
2 answers
1

One of the approaches you can do is below.

  1. I am assuming you already have your Domain Model setup. That is, you should have your UserDetails entity related to Activity entity in a 1 to Many relationship in such a way that 1 UserDetails Entity is related to Many Activities Entity(assuming that each activity is added by a unique user and it is unique to him/her)
  1. Create an Overview page for the UserDetails entity with a DataGrid in it with Database as DataSource.
    1. in the New, Edit buttons of this Page, create a New Page with a DataView in it which takes the UserDetails as the context object
    2. then add another data grid inside this dataview but this time choose the Datasource as from Association. Choose the association that you made earlier between UserDetails and Activity entities here
    3. In this Grid add 2 buttons New and Delete which should be Microflow buttons
    4. in New button microflow, create a new object activity and set it with the outermost UserDetails entity object and then open a new/edit page with dataview with Activity as context object
    5. in Delete button microflow, just do a delete object activity with refresh in client

With this you can achieve your requirements i think.
Let me know how it went.

 

answered
2

Hi Soham Rakhade,

 

You can go through the below part of the learning path (Nested Data )

 

https://academy.mendix.com/link/modules/93/lectures/2794/-6.1-Information-Entity

 

This module is similar to your use case. You can revert back here if you are not able to follow :)

answered