Hi Support
Can you provide me sample code implementing gantt for Sharepoint ONline REST API? I have a table of Projects with ProjectName, Start & Funish Dates, Duration & %Complete as follows
REST for Projects - https://epmsolutions.sharepoint.com/sites/grc/_api/projectdata/Projects?$select=ProjectName,ProjectDuration,ProjectPercentCompleted,ProjectStartDate,ProjectFinishDate,ProjectOwnerName
ProjectDuration m:type=" Edm.Decimal “>6048.160000</d:ProjectDuration>
ProjectFinishDate m:type=” Edm.DateTime “>2019-11-26T08:09:36</d:ProjectFinishDate>
ProjectName>010 ON-CALL CITYWIDE PAVEMENT REHABILITATION 2019</d:ProjectName>
ProjectOwnerName>Administrator Admin</d:ProjectOwnerName>
ProjectPercentCompleted m:type=” Edm.Int16 “>75</d:ProjectPercentCompleted>
ProjectStartDate m:type=” Edm.DateTime ">2017-01-01T08:00:00</d:ProjectStartDate>
The above requires credentials which I will supply by private email.
Thanks.
ramil
April 9, 2019, 10:30am
#2
Hello Greg,
Unfortunately, we don’t have a demo for SharePoint and SharePoint Online.
You can check the following articles, maybe it will help you to create the project in SharePoint:
https://docs.dhtmlx.com/gantt/desktop__server_side.html#customrouting
DiWorm
April 9, 2019, 10:49am
#3
There is a bad piece of code, but you can optimize it. This is my experiment on local sharepoint with dates. I use Moment JS for converting times
function getTodayDate() {
today = moment().format('YYYY-MM-DD');
minDate = moment().subtract(90, 'days').format('YYYY-MM-DD');
maxDate = moment().add(90, 'days').format('YYYY-MM-DD');
fromDate = moment(today, 'YYYY-MM-DD').subtract(2,'days').format('YYYY-MM-DDT00:00:00')+"Z";
toDate = moment(today, 'YYYY-MM-DD').add(1,'days').format('YYYY-MM-DDT23:59:59')+"Z";
filterDate = 'and (PlannedTimeStart ge datetime\''+fromDate+'\') and (PlannedTimeStart le datetime\''+toDate+'\')'
}