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
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 ) ) ) ) )
While this technically works, I highly suggest to use a!localVariables() instead of with() and NOT to query data in a loop. Try to fetch the required items in one go and remap them in a second step.
You're right, updated the code mockup.