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
Could you double check to see if the student record has been synced? Also check to see if for that specific class.id you have more than 10 students.
I think you are trying to relate the record whose source is a view(in Entity backed record), we can't get advanced features options when we are using View a source (features like record relations , record sync's are not possible )
yes I checked
Hi, We can get max of 10 related record data and if we need more we need to query them separately.
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.