Save

 

Dovico.TrackITAPI.CTrans.Save(System.String,Dovico.TrackITAPI.CStateInfo)

 

 

Function Overview:

Saves time information passed in in the format trans.xsd. This method can calculate the START, STOP and TOTAL of a time entry. In order for the method to calculate properly it needs a combination of the following items - (1. TOTAL only, 2. START and TOTAL, 3. STOP and TOTAL, 4. START, STOP and TOTAL). If only TOTAL is specified then START is derived from 'start from last' time. In order to specify a time entry that is non-billable pass in a CONSTANTS.OVERTIME_NON_BILLABLE_ID as the value for OTRATEID.

 

 

Parameter List:

sXml - string - string of xml in the format

siState - CStateInfo - State information needed to process the transaction

 

Returns

A string of xml containing the IDs of inserted and updated items.

 

Example:

// build up xml to insert a time entry into the database. Notice that many

// of the time entry fields are not specified because they are filled in

// on the fly based on project task and employee selected for the time entry

// with all new time entries, WASLINKED should be F (false)

string sXml = "<Trans:TRANS xmlns:Trans=\"http://www.dovico.com/schemas/trans.xsd\">";

sXml += "<TRAN ID=\"-1\" PROJECT=\"100\" TASK=\"100\" EMPLOYEE=\"100\" ";

sXml += "DATE=\"2004-05-10T00:00:00\" START=\"\" STOP=\"\" TOTAL=\"1.67\" OTCOSTID=\"0\" ";

sXml += "OTRATEID=\"0\" DESC=\"example\" WASLINKED=\"F\" OUTSIDE=\"\" INTEGRATE=\"\"/>";

sXml += "</Trans:TRANS>";

// call the method to save a new time entry

wsapi.MethodInvoke("TransSave", sXml, stToken);