Get Customfield in EventAPI

Get Customfield in EventAPI

by Trayan Raykovski -
Number of replies: 1

Hi,

I am building a plugin. I have added a custom field with the new plugin. The I have added an observer on the event API on course created. The problem is that the \core\event\course_created event runs before the custom field is saved.

Could somebody give me an idea as to how can I access the customfields data when a course is created?

Or is there an event for that?

Any suggestion will be much appreciated!

Average of ratings: -
In reply to Trayan Raykovski

Re: Get Customfield in EventAPI

by Mark Sharp -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
I had something similar with course_module_updated event being called before other course module settings were saved (plagiarism settings). My work around was to create an adhoc task to run a minute or two after the event.

There is no separate event for saving custom field data.

It might be worth raising a tracker item for the timing of the course_created/updated events to happen after the custom fields have been saved.