Difficulty in setting Related Records

15 posts by 2 authors in: Forums > CMS Builder
Last Post: November 4, 2022   (RSS)

By Dave - November 4, 2022

Yea, it looks like outpatients_clinicnum is blank.  Does it show as having a value on the edit page you're on? 

Dave Edis - Senior Developer
interactivetools.com

Just to be sure that everything is correct. In 

<?php echo @$RECORD['outpatients_clinicNum']; ?>

outpatients_clinic is the section name that contains the patients' data. 

Is it correct?

By Dave - November 4, 2022

You want the number of the patient record.  Maybe it's one of those fields with a value of 867?  

One way to do it is to work in reverse.  Go to the patient edit page you want to get to, copy the URL for that page down, and try to generate the URL from within the code on the visits page.

Let me know if that works for you.

Dave Edis - Senior Developer
interactivetools.com

Hi Dave

Thank you a lot for your assistance. It did work finally!! I changed the 

<?php $patientRecordNum = $RECORD['outpatients_clinicNum'] ?? ''; ?>

to

<?php $patientRecordNum = $RECORD['foreignFieldNum'] ?? ''; ?>

For some reason, the outpatients_clinicNum can be found. Changing this to foreingFieldNum seems to fit.

Kind regards. Have a nice weekend.

Andreas

By Dave - November 4, 2022

Nice work!  Glad it's working now. :-) 

Have a great weekend.

Dave Edis - Senior Developer
interactivetools.com