• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

How to auto‑create related row on edit in Edit Grid (left join, no program)?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to auto‑create related row on edit in Edit Grid (left join, no program)?

    We are working with two physical files:
    • File 1 (main file) — contains multiple fields and acts as the primary dataset.
    • File 2 (comments file) — contains only the key fields from File 1 plus a COMMENT field. This file is used to store user?entered comments for each record in File 1.
    To maintain comments, we created a Data Source in Valence using a LEFT OUTER JOIN where File 2 is joined to File 1 on matching key fields. An Edit Grid is built on top of this data source. In the grid, only the COMMENT field (coming from File 2) is editable. The final application simply displays this Edit Grid and is expected to handle all updates automatically.

    The issue we are facing:
    Updating comments works perfectly when a corresponding row already exists in File 2 for the selected record from File 1.
    However, when a record from File 1 does not have a matching entry in File 2, the Edit Grid still allows the user to type in a comment, but when saving, nothing gets inserted into File 2. The save attempt is ignored because there is no existing row to update.

    Technically, in such scenarios, when a user enters a comment for a File 1 record that does not yet exist in File 2, the expected behavior would be for Valence/Nitro Apps to automatically insert the new row into File 2 (using the key fields from File 1 along with the entered comment). But this does not happen automatically.

    Our question:
    Is there any configuration?based or no?code/low?code way in Valence/Nitro App Builder to make the Edit Grid automatically insert a new record into File 2 when the user edits the comment on a row that has no existing match in File 2?
    ?In Short can edit grid perform Insert a record if missing and update if present?

  • #2
    We are looking into this. We too have found that this scenario is not handled and even using the EXNABVAL program would not fully solve this either.

    Comment


    • #3
      The next update will handle this better. It will now recognize that a record needs to be added to the table. However, the developer will be responsible for populating any other necessary fields/columns for that record. These values may be populated by the user (via the edit process if those fields are selected to be editable), app variables (set value link), and/or a EXNABVAL based program using SetValue.

      Comment

      Working...
      X