subform not keeping history of changes

Confluence User - 25 Nov, 2020

Hi,

I am building a simple approval process (taking the Expenses Claims app as example).

There is lots of back and forth between two users. One person edits and the other reviews , add comments and can accept/reject the changes. If the reviewer rejects, the flow goes back to the editor to implement the new changes. 


I am using a subform to store the reviewer comments/decision. What I have noticed is that the ID of the record in the subform matches the ID of the parent record. Is that normal?


The problem is that only the last record of the changes is kept in the database.

How can I design my forms so that all the reviews are kept?

forms;subforms

4


25 Nov, 2020
confluenceUser
confluenceUser

The ID of the subform record should not matches the ID of the parent record. Instead it should match the foreign key field in the subform and this foreign key field is a hidden field in your subform.

In the subform property for "
Parent Field to Keep Subform ID" and "Subform Field to Keep Parent ID", do not use the 'id' as the field value. The Subform Field to Keep Parent ID" must be the foreign key field id of the subform.

In your Joget platform, look at the default Internal Service Request app for example on using subform as audit trail for remarks.

25 Nov, 2020
confluenceUser
confluenceUser

Hi Matthew,


I went through the Internal Service Request app in detail. I was missing 2 things

1) Parent Field to keep Subform ID

2) Use a Bean Shell Binder as a Load Binder and return null


In the knowledge base it says 1) is optional. I do not understand why I need it here?

As for 2) I have no idea why we need to do this. Can you please explain?  

27 Nov, 2020
confluenceUser
confluenceUser

A "Bean Shell Binder as a Load Binder and return null or false" means to not run the load binder. The app does not need to load anything or populate any field when loading the form. Only the save binder is used to save the comments, etc.

29 Nov, 2020
confluenceUser
confluenceUser

By doing these

1) Parent Field to keep Subform ID

2) Use a Bean Shell Binder as a Load Binder and return null

The subform will be saved as new record, therefore able to preserve any previous records. Once you have this design, you can use multirow binder and load all the records into a grid.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print