Customfields: Fill in a dropdown menu field via API (core_course_update_courses)

Customfields: Fill in a dropdown menu field via API (core_course_update_courses)

by Anton Tremetzberger -
Number of replies: 2
Picture of Particularly helpful Moodlers

Dear Community,

We would like to use the customfields (type: dropdown menu field) and wan't to fill in values via webservice call (core_course_update_courses). The customfields and values will be created by us in advance, eg:
fieldname: category
dropdown menu entrys:

  • Winter term 2019
  • Summer term 2020
  • Winter term 2021

...


Arguments:

customfields  Optional //Custom fields
list of ( 
object {
shortname string   //The shortname of the custom field
value string 


Does anyone know if it is possible to fill in values in a field of type dropdown menu?
What's the value string? Is it eg "Winter termin 2019"?

thanks, best regards
Anton

Average of ratings: -
In reply to Anton Tremetzberger

Re: Customfields: Fill in a dropdown menu field via API (core_course_update_courses)

by Anton Tremetzberger -
Picture of Particularly helpful Moodlers
Dear Community,
together with our IT Department we did some tests, maybe is also interesting for you. If you use a dropdown menu field, you have to use IDs:
ID=0: no entry
ID=1: first entry of dropdown field --> Winter term 2019
ID=2: second entry of dropdown field --> Summer termin 2020
.....

br, Anton
In reply to Anton Tremetzberger

Re: Customfields: Fill in a dropdown menu field via API (core_course_update_courses)

by Mayank Tyagi -
Thanks for sharing. But it is not a surprising/interesting information for any developer. Bcs for developement as a good practise we use ID( As numeric) always. It is also helpful to store it in DB.