Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Data Merge and addInstance in same document - via a "Create New" button

Avatar

Level 6

I’m looking for a method of creating additional instances of a letter where the Date, First and Last name, and Address fields are added to new subform instances via a “create new” button.

As an illustration:

The top of Page 1 would contain a subform with the following fields: Date, First name, Last name, Address.

The next subform (called Letter) would have a pagination of “Top of Next page” (so it starts on its own separate page) and would contain the same fields as referenced above, as well as a few lines of boilerplate text (serving as the letter body).

I would like there to be a “Create New” button that would auto-create a new instance of the Letter each time it’s pressed AFTER the user enters data in the fields.  So for example…the user enters a date, first and last name, and address then presses the “Create New” button….the subform gets populated with the current data and either a new blank instance of the Letter subform is generated, or nothing happens until the button is pressed again.

The user would then press a clear/reset button to clear the fields (or this can be done automatically after pressing “create new” button is pressed). Next he would add new data in the fields and again press “Create New” and a new populated subform will be created, under the previous.

I know this entire process is similar to “importing” an XML data file and having a new instances of the subform created automatically for each data record, but I’m trying to prevent “importing” records/files, and would rather have everything self-contained.

Any ideas?

Thanks.

0 Replies