Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

Project Server 2013 JSOM - Read Custom Field Values

$
0
0

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


Viewing all articles
Browse latest Browse all 5347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>