I am not getting all the records for a record type relationship

I have a Class record type and a Student Record type with a relationship between them one-to-many.

when I try to get a Class with all the students (every student contains classId) I get only 10 of them but I have much more.

how can I fix it? 

a!queryRecordType(
  recordType: 'Class',
  fields: {
    'Class.relationships.Student'
  },
  filters: a!queryLogicalExpression(
    operator: "AND",
    filters: {
      a!queryFilter(
        field: 'Class.Id',
        operator: "=",
        value: ri!id
      )
    },
    ignoreFiltersWithEmptyValues: true
  ),
  pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 100
  )
).data[1]

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Obviously will be a hit to performance but you can get around it w/ an update() and a second query. 

    Took some guesses with the data structure but maybe something like this:

    a!localVariables(
      local!class: a!queryRecordType(
        recordType: 'Class',
        fields: { 'Class.relationships.Student' },
        filters: a!queryLogicalExpression(
          operator: "AND",
          filters: {
            a!queryFilter(
              field: 'Class.Id',
              operator: "=",
              value: ri!id
            )
          },
          ignoreFiltersWithEmptyValues: true
        ),
        pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 100)
      ),
      local!student: rule!TMP_queryStudent(classId: fv!item['Class.Id']).data,
      todatasubset(
        a!forEach(
          items: local!class.data,
          expression: a!update(
            fv!item,
            'Class.relationships.Student',
            index(
              local!student,
              wherecontains(
                ri!id,
                tointeger(local!student['Student.ClassId'])
              ),
              null
            )
          )
        )
      )
    )

Reply
  • 0
    Certified Senior Developer

    Obviously will be a hit to performance but you can get around it w/ an update() and a second query. 

    Took some guesses with the data structure but maybe something like this:

    a!localVariables(
      local!class: a!queryRecordType(
        recordType: 'Class',
        fields: { 'Class.relationships.Student' },
        filters: a!queryLogicalExpression(
          operator: "AND",
          filters: {
            a!queryFilter(
              field: 'Class.Id',
              operator: "=",
              value: ri!id
            )
          },
          ignoreFiltersWithEmptyValues: true
        ),
        pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 100)
      ),
      local!student: rule!TMP_queryStudent(classId: fv!item['Class.Id']).data,
      todatasubset(
        a!forEach(
          items: local!class.data,
          expression: a!update(
            fv!item,
            'Class.relationships.Student',
            index(
              local!student,
              wherecontains(
                ri!id,
                tointeger(local!student['Student.ClassId'])
              ),
              null
            )
          )
        )
      )
    )

Children