Developer Q&A
Help with adding a TimeCardItem
Hi,
We are trying to add TimeCardItem to a TimeCard but get error: "TimeCard is a required field"
These are our steps:
-
We invoke GetTimeCardCommand to get a TimeCard instance.
Dim tc As New corrigoEnterprise.GetTimeCardCommand()
tc.BaseDate = "2021-11-20T13:00:00"
tc.EmployeeId = 50Dim resTC As TimeCardActionResponse
resTC = corrigoService.Execute(tc) -
Then we build the TimeCardItem
Dim tci As New corrigoEnterprise.TimeCardItem
tci.TimeCard = resTC.TimeCard;
<... and we complete all required fields of object tci ...> -
Finally we execute passing the timeCardItem instance as cmd.entity:
Dim cmd As New CreateCommand()
cmd.Entity = itm
Dim resTCI = corrigoService.Execute(cmd) -
We get the following error: "TimeCard is a required field"
Considering that our object could be improperly built, we fetched one TimeCardItem, modified StartDate, EndDate, ConcurrencyId=0, and Id=0, and executed an insert command with this object, totally valid from Corrigo. We am getting the same error: "TimeCard is a required field".
Please help.
Thank you!
Juan