pipedrive-dotnet icon indicating copy to clipboard operation
pipedrive-dotnet copied to clipboard

DueDate field data type parsing

Open gregarican opened this issue 4 years ago • 4 comments

A few JSON response body parsing exceptions seem to occur when handling the due_date field. These specifics files seem to have been affected.

public DateTime? DueDate { get; set; }

Models/Request/ActivityUpdate.cs Models/Response/Activity.cs Models/Response/DealActivity.cs

Testing out an API request/response pair accordingly might shed some light on this. In my own forked project I changed the data type to string and had more consistent parsing results.

gregarican avatar Sep 02 '20 16:09 gregarican

Are you using the latest version? I've updated my integration tests for the creation/update of the activity and it's working fine 42177094ab7ee77e0a230d0dd01627bf6b0541b1

DavidRouyer avatar Sep 02 '20 16:09 DavidRouyer

Another comment about this. Previously if my code updated a deal (e.g. - change its status) the only other field value I had to provide in my update dataset was the deal's dollar value. The other fields remained unchanged after the API request was fulfilled. You'd expect that any fields not passed into the method properties would be ignored. Which was the case.

When I compiled v0.53.0 against my project and ran it last night I found that the expected_close_date field is nulled out when I issued the same deal update API requests I have been. So now I am trying adding that date to the update dataset to ensure it's retained after the API request is fulfilled.

gregarican avatar Sep 03 '20 13:09 gregarican

The correct way to update an entity is to do like that:

  var deal = await client.Deal.Get(dealId);
  var dealToUpdate = deal.ToUpdate();
  //dealToUpdate.StageId = stageId; The fields you want to update
  await client.Deal.Edit(deal.Id, dealToUpdate);

DavidRouyer avatar Sep 03 '20 15:09 DavidRouyer

Ahhh, I see now. After I hit this I then assumed that I would need to pull in the existing deal as a reference point to fill out the update. Thanks for the clarification!

gregarican avatar Sep 03 '20 15:09 gregarican