I am working on editable grid where I am adding invoice items for students training. I have two tables which are Invoice_Details and Student_Training_Details. When I am adding the Invoice_Details in the editable grid, I also need to enter the Training_Completed_Date for each student which is a field in Student_Training_Details. How can I achieve this? I have the foreign key FK_STUDENT_ID in both the tables. Thank you.
Discussion posts and replies are publicly visible
My personal preference when having data that should apply to multiple tables is to set up the data so that it gets saved on clicking your submit button. You can be confident that the data is in the correct state on button click, so it's easy to then save any data to the appropriate fields at that point.
Here's an example - I'm assuming in this case that the "Student_Training_Details" is a very simple CDT, with just an ID, FK_STUDENT_ID, and TRAINING_COMPLETED_DATE. Then, I'm running a forEach across each item in the "Invoice_Details" to create a new item of the "Student_Training_Details" for each row in the "Invoice_Details". Here's a sample expression for the button click:
© 2021 Appian. All rights reserved.