Search the GP Tables
Search by TABLE NAME
Search by FIELD NAME
These are our SOP scripts. All of our scripts for Dynamics GP can be found here
DynDeveloper.com

DynDeveloper.com

Table Edits Forum Articles
Table Edits 0 Table Edits 0 Table Edits 0
Sign Up Now!Log In
Ranger 2/7/2013 4:56:42 PM

UpdateTxEntity vs CreateTxEntity

hi all,

well, im getting much closer in my timesheet import project.  however, i ran into a snag. 

Day one: 2/1/2013 - employee #0001 and #0002 both with 8 hours.

Day two: 2/2/2013 - employee #0001 with 8 hours.

so if you already have a timesheet setup for an employee, and you need to simply add a new line to an existing timesheet, then using "CreateTransactionEntity()" might not be the answer. 

I figured that "UpdateTransactionEntity()" would be the way to go.  However, you cant just add the line to the xml document, since it must have the header part as well.   so i made sure that the xml document had the header AND the new line to insert, but then it complains that the timesheet document already exists (even when using the updatetransactionentity econnect command).

so at this point i decided that if the timesheet already exists, to just do an insert directly using the stored procedure "taPATimeSheetLineInsert".  This worked just fine, i inserted the line for 2/2/2013 for 8 hours for employee 0001.  the problem is when i get back into GP and look at that timesheet, it throws an error saying the distributions are not correct.

So how would you enter new lines in a timesheet that already exists?  Each employee gets their own timesheet, and there will be a project timesheet for each day, so i need to be able to add lines to existing timesheets.  Is there another stored procedure that runs that does these distributions?  in the database, there are some extra stored procedures "taPATimeSheetLineInsertPost" and "taPATimeSheetLineInsertPre".  what do these do?

 

Here is my work-around if all else fails:

if timesheet exists for employee, then create a dataset with header and detail tables,

1.  pull in the header and all detail lines from the timesheet in PA10000/PA10001 

2.  add new timesheet line to this in memory dataset. 

3.  delete existing timesheets in PA10000 and PA10001 that match that ts number

4.  re-create timesheet using econnect from the in memory dataset

NOT EFFICIENT AT ALL.  but would be a work around.

 

 

thanks in advance.

Version: GP 2010
Section: .NET Development, eConnect








Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
site