Users in our organization currently have to complete a number of different forms when an accident occurs. I am creating a .pdf that combines these fomrs into one, with the first portion being a data input section where the user inputs the data and then this populates other sections (pages of the form) that can later be saved and printed.
The data input section contains subforms with tables. The tables have a row that has "add new item" and "delete this item" buttons. The rows have dropdown list fields.
I would like to create a field that will be automatically filled in with the values from the dropdown lists, including the values from the new rows that are added using the 'add new item' button.
Any assistance in this regard would be most appreciated. This is my first time on a forum, so I apologize if I have not been clear.
First of all you need to decide at what point you want to populate this field with the drop down selections. I think you have two options.
Option 1 - Automatically calculate this field each time a user makes a drop-down selection. It's possible that a user will enter data and then change a drop down value so you'll have to account for this.
Option 2 - Create an update button that users click to calculate this field. There is still a risk that users will change the value in the drop down after clicking update, so you would want to use scripting to lock those fields (e.g. make them protected) when the update button is clicked. You could then change the caption of this same button or have a second button that when clicked would unlock those drop down fields.
calculatedField.rawValue = "The accident occurred on " + table.row1.date.rawValue + ". It was witnessed by " + table.row1.witness1.rawValue +
" and " + table.row1.witness2.rawValue + ".";