Hi,
New to Designer and making some headway...
I've got a field to count the number of patients on a form. Each patient's details are in a subform, which is within a container. There's buttons to add or delete a patient/subform which is working fine.
I'm struggling with getting the field to show the number of patients/subforms.
I've put this code into the 'calculate' event of the field:
$.rawValue=Count(PatientContainer.PatientDetailsSubform.Line1[*])
'Line1' is an element withing the PatientDetailsSubform. I did have it as 'Surname' but the count only goes up when it's non-null and even then it only seems to count the first subform. To be honest, Line1 doesn't work at all...
Thanks in advance,
Simon.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Simon,
You can use the instanceManager() to count the numer of subforms. As you have mentioned PatientDetailsSubform contains the information about the patient so you can count the instances of this subform to get the no.of patients.
var patientCount = PatientContainer.PatientDetailsSubform.instanceManager.count;
Thanks,
Bibhu.
Views
Replies
Total Likes
Hi Simon,
You can use the instanceManager() to count the numer of subforms. As you have mentioned PatientDetailsSubform contains the information about the patient so you can count the instances of this subform to get the no.of patients.
var patientCount = PatientContainer.PatientDetailsSubform.instanceManager.count;
Thanks,
Bibhu.
Views
Replies
Total Likes
Thank you, Bibhu - perfect!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies