Set Finish Project Column via API

Viewed 118

When I attempt to set the Finish column on a row in a sheet via the SmartSheet API, I get the following message:

{
    "errorCode": 1080,
    "message": "End Dates on dependency-enabled sheets cannot be created/updated. Please update either the Duration or Start Date column.",
    "refId": "19ufon4xzsn7y",
    "detail": {
        "index": 0,
        "rowId": 4987804240111492
    }
}

If I want to clear the project dates for a specific row I can set the Duration and Start columns to null, but the Finish date remains. See https://smartsheet-platform.github.io/api-docs/#update-rows

What is the programmatic way to clear the project dates, including Finish, for a row?

2 Answers

I was able to update the Finish Date programmatically on a dependency enabled sheet via the API.

In order to do so I had to pass the date string in their specified format, and populate the strict property = true on both of the Start Date and Duration cell objects.

Using C#, you can get the date string formatted correctly using this code: startDate.ToString("O")

I don't believe it's possible to programmatically update Finish date whenever dependencies are enabled for the sheet. Note, this is the sheet setting (in the Smartsheet UI) that specifies dependencies are enabled for a sheet:

enter image description here

If I manually uncheck this box and save the change via the Smartsheet UI, then I'm subsequently able to successfully update Finish dates via the API. Unfortunately it doesn't seem possible to disable dependencies for the sheet via API (i.e., the programmatic equivalent of unchecking this box). I tried doing so, but received an error indicating that you cannot set the dependenciesEnabled property via API.

REQUEST:

PUT /sheet/{sheetId)
{
   "dependenciesEnabled": false
}

RESPONSE:

{
    "errorCode": 1032,
    "message": "The attribute(s) sheet.dependenciesEnabled are not allowed for this operation.",
    "refId": "10pl3li0rs9b"
}
Related