Read Project Information Using CSOM Project Online

Read Project Details Using CSOM:-

Read Project Information Using CSOM Project Online. Read Project Details using CSOM in Project server is about all the description of the project. As project start Date, Finish Date, Percent Complete, Project Type and Project Resource assigned to project etc. Basically, CSOM is used in project online development. project online have some restriction to development using Project Server Interface(PSI). So below is code to Read Project Details Using CSOM.[AdSense-A]

string PWAPath = "Your Online 'PWA Path'";
string UserName = "UserName";
string PassWord = "Password";
SecureString SecureStringPassword = new SecureString();
using (ProjectContext ProjectContext = new ProjectContext(PWAPath))
{
foreach (char Char in PassWord.ToCharArray()) SecureStringPassword.AppendChar(Char);
ProjectContext.Credentials = new SharePointOnlineCredentials(UserName, SecureStringPassword);
ProjectContext.Load(ProjectContext.Projects,
Pro => Pro.IncludeWithDefaultProperties(projectDetail => projectDetail.StartDate, projectDetail => projectDetail.FinishDate, projectDetail => projectDetail.Tasks, projectDetail => projectDetail.PercentComplete, projectDetail => projectDetail.ProjectResources, projectDetail => projectDetail.CustomFields, projectDetail => projectDetail.EnterpriseProjectType));
ProjectContext.ExecuteQuery();
foreach (PublishedProject Project in ProjectContext.Projects)
{
string ProjectName = Project.Name;
int PercentComplete = Project.PercentComplete;

//You can find all project detial as same
}
}

 


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

error: Content is protected !!