I am using Moodle manual enrol external method ‘enrol_manual_enrol_users’ to enrol users based on some condition. I have multiple manual enrolment methods based on the role for one course. I don’t get the correct enrolment id to ‘prefix_user_enrolments’ table. When I looked into code, I realized it is not considering role id, when retrieve enrolment instance for the course. If there are multiple values, it will basically get the first element.
Did anyone else experience the same issue? Did I do anything wrong or missing anything? Thanks for your help.