Hey Everyone,
I think I have a simple question here, but how do you read custom field values with JSOM? I can read in any built in fields like below:
//Call to JSOM projContext.load(projects, 'Include(Id, Name, ProjectSiteUrl, Project Sponsor)'); //From Success Method var enumerator = projects.getEnumerator(); var destination = $('#div_Projects'); var result = ''; while (enumerator.moveNext()) { var project = enumerator.get_current(); var projectCFs = project.get_customFields(); result += project.get_id(); result += '<strong>' + project.get_name() + '</strong>'; result += project.get_projectSiteUrl(); result += '<br />'; }
Notice how in my Call I Include "Id", "Name", "ProjectSiteUrl", and then a custom field called "Project Sponsor". Then, in my iteration method I can call get_id(), get_name(), but a call to get_projectSponsor() fails.
Anyone know how to read custom field values with JSOM?
120811049008