Skip to main content
mollyn6512
January 9, 2023
Question

Query 2 record types in gridField()

  • January 9, 2023
  • 2 replies
  • 0 views

My interface is now using a record type (data source is a process report) to show a list of cases info, now I want to add into this interface 2 additional columns, but the data for these 2 columns is in another record type, and the common field to get the right data is "caseID". 

 Is there any possible way to query the data from the other record type back to this interface? I tried but couldn't point to the exact case ID...

a!boxLayout(
    label: "My Pending Tasks",
    contents: {
      a!gridField(
        label: "",
        labelPosition: "ABOVE",
        data: 'recordType!Cases',
        pageSize: local!selectedPageSize,
        columns: {
          a!gridColumn(
            label: "Case Id",
            sortField: 'recordType!Cases.fields.caseId',
            value: a!richTextDisplayField(
              value: a!richTextItem(
                text: if(
                  rule!AAA_CMN_IsBlank(
                    fv!row['recordType!Cases.fields.caseId']
                  ),
                  "-",
                  fv!row['recordType!Cases.fields.caseId']
                )
                ),
                a!gridColumn(
            label: "Created Date",
            sortField: 'recordType!Cases.fields.createdDate',
            value: a!richTextDisplayField(
              value: a!richTextItem(
                text: if(
                  rule!AAA_CMN_IsBlank(
                    fv!row['recordType!Cases.fields.createdDate']
                  ),
                  "-",
                  fv!row['recordType!Cases.fields.createdDate']
                )
                ),a!gridColumn(
            label: "Updated Date",
            sortField: 'recordType!Cases.fields.updatedDate',
            value: a!richTextDisplayField(
              value: a!richTextItem(
                text: if(
                  rule!AAA_CMN_IsBlank(
                    fv!row['recordType!Cases.fields.updatedDate']
                  ),
                  "-",
                  fv!row['recordType!Cases.fields.updatedDate']
                )
                ),
                 a!gridColumn(
            label: "Case Owner",
            value: rule!AAA_CMN_General_queryRecordDataHelper(
              recordType: 'recordType!Cases Information',
              filters: a!queryFilter(
                field: 'recordType!Cases Information.fields.caseId',
                operator: "=",
                value: fv!row['recordType!Cases.fields.caseId),
                pagingInfo: a!pagingInfo(1,1),
                fields:'recordType!Cases Information.fields.caseOwner)
            )
                )}

    2 replies

    harshitb6843
    January 9, 2023

    Have you established a record relationship between the two? Once you do that, it will become really easy to query the related data, 

    mollyn6512
    January 10, 2023

    Is it possible to establish relationship between a report based record type and a DB based record type?