Accessing custom course fields

Accessing custom course fields

by Robby Schanilec -
Number of replies: 3

For our use we need to send some of the cert data to a regulatory organization. I'm trying to find out how to access these field values on the customecert\view.php  with no success. I've tried the $customcert, $cm, and $course objects but none of them seem to have them. For instance one of the course fields we added is called certlevel I need to be able to access that value to insert into a Soap message.  Anyone know how to access these custom course fields from the view.php file? I could just call them directly in the DB but they must already exist in some variable to output to the PDF so I would rather just coopt that object.  Thanks!

Average of ratings: -
In reply to Robby Schanilec

Re: Accessing custom course fields

by Mark Nelson -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
In reply to Mark Nelson

Re: Accessing custom course fields

by Robby Schanilec -
I have looked there and through a lot of the other files. I don't see a way to just grab the value of specific custom course fields. Are you saying I should add code there or does the functionality I'm looking for already exists? I'm trying not to add too much due to it having to be modified with each update.
In reply to Robby Schanilec

Re: Accessing custom course fields

by Mark Nelson -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
You will have to add code to grab the value. It won't be in $customcert, $cm, and $course.