Skip to main content
madhup0005
February 25, 2025
Question

Related Record type in Editable grid

  • February 25, 2025
  • 5 replies
  • 0 views

Hi Everyone, 

In my case i have 2 record types first one is  Case Summary and second record is case summary Items.

I have one to many relationship. like- the primary key of case summary have foreign key constraint  from case summary items record.

Now i have to make an editable grid in  which i will show all items from case summary items records but behalf of relations with case summary id . Now i am confused how can i achieve this because i have to write records at same time for summary records and case summary item records.

Means have to use a!writeRecord() in interface which will update both summary and items records with relationship.

can anyone help me on this.

Thanks in advance

    5 replies

    andrewh6762
    February 25, 2025

    I'm confused as to what you are trying to do and what you are asking. From what I can see you have a CASE_Summary and CASE_SummaryItems record with many CASE_SummaryItems for a single CASE_Summary. These are somehow displayed in an editable grid and you are wanting/needing to use the a!writeRecords() smart service to write changes made in the editable grid.

    Are you asking how to complete this write to the DB with the a!writeRecords() function?

    madhup0005
    February 26, 2025

    Thank you Andrew for your response.

    Yes, You are right , i want some ideas how can i show that data in editable grid.  because in eidtable grid i will only show caseSummary items and then i want whatever changes made in editable grid will be save in record with a!writeRecord (). 

    Below is the attached image where , this is a mockup image i have to show caseSummary items list as below image and on completed checkbox saveinto i will be use a!writeRecords() and need to write data in both the relationship record with one local variable.

    I am able to fetch data with relationship in one local variable now in which i have summary 1 and it's 7 items.

    can you give some example how can i use this in editable grid and write changes data with summary and items.

    tejasn0320
    February 26, 2025

    There are multiple ways to achieve this:

    First Approach:

    1. After editing the grid, provide the user with an option to save.
    2. Upon clicking the save button, trigger a process model that writes the updated records.
    3. Use refresh variables after the process model successfully completes the write action. This ensures the page reloads with the latest values.

    Second Approach:

    1. After editing the grid, directly call the Write Record smart service to update the values.
    2. Once the update is successful, refresh the data variables to reflect the latest changes.

    Both approaches ensure that the grid displays the updated values effectively.