Unable to read Task customField value using JSOM


  • Hi All,

    I'm trying to read Task level customfield value for a given project using JSOM. I can able to read the custom field's name and its internal name but getting undefined error while reading its value.

    Any help would be greatly appreciated.

    Below is the piece of code , is there anything wrong in the below code?

    projectContext.load(AllTasks, 'Include(Id, Name,CustomFields,IncludeCustomFields, FieldValues)');


    function  doWithTask(TaskInfo){  //for every individual task

     // alert('Task Name: ' + TaskInfo.get_name());     

    var fieldValues = TaskInfo.get_fieldValues();     

    var CFenumerator = TaskInfo.get_customFields().getEnumerator();         

    while (CFenumerator.moveNext()) {             

       var customField = CFenumerator.get_current();

       alert(customField.get_name() + " = " + fieldValues[customField.get_internalName()]);




    Jumat, 26 Oktober 2018 06.13


  • Finally, I've sorted it out after spending so much time..

    Here, the task CF syntax is little different compare to the Project CF syntax. The below statement has given me the Task CF value.


    Selasa, 30 Oktober 2018 10.53