hi all,
so i am making this timesheet import thing using infopath, a sharepoint sequential workflow and eConnect. i have written and re-written this thing a few times now.
we have an infopath timesheet that is by project. each day, we want our payroll guy to import the timesheets into GP, so he doesn't have to print out the form and hand-enter all the time entries and bonuses. So, i have written a sharepoint 2010 workflow that will pull the info out of the IP timesheet and put it in the GP database using eConnect. On the following day, the same process will occur, and he will import the next day, adding a timesheet line to the existing timesheet for that employee. My code works....i can import 2/1, then 2/2, then 2/3......but......
For any given employee, i have to destroy the existing timesheet in the GP database, so i can re-issue the complete document via eConnect. The reason i have to re-issue the whole thing, is that eConnect wont let me add only a line to existing timesheet...it complains that it must have the header in the XML document. I tried doing an insert using the stored procedure "taPATimeSheetLineInsert", but it screws up the distributions, and the GP UI will throw an error. This is why i reconstruct the employee's timesheet every day and resubmit it (adding the new line each time).
So, at day 4 for a shop timeticket, one employee will have 4 detail lines. so at day 4, i pull the existing records from GP (pa10000 and pa10001) into a local dataset. then i pull the next timesheet and add another detail record to that dataset. then i serialize the dataset into the econnect document type for a pa timesheet.
Once i issue the command "CreateTransactionEntity(oeConnectType)", everything looks like it works. When i go to the database and look at what has been created, ALL of those detail lines have the most current date....so in other words, it forced that last date into ALL detail lines in the PADT field.....this is not good.
now, for this employee's timesheet, i have 4 entries in the PA10001 table all saying they were say 2/7/2013, when in fact, it was issuing an 8 hour line entry for teh 4th, 5th, 6th and 7th.
any ideas?