Time Bill (Track Time)

A time transaction, also known as TimeBill, records the hours worked by an employee. This transaction can be used to record billable hours and invoice customers. This transaction is available when the Time Tracking feature is enabled.

For details about this type of transaction, Managing Time Tracking.

The TimeBill record is defined in the tranEmp (employees) XSD.

Important:

The TimeBill record is labelled as the Track Time record in the UI.

Supported Operations

The following operations can be used with TimeBill records:

add | addList | deleteList | get | getList | getSavedSearch | getSelectValue | search | update | updateList | upsert | upsertList

Note:

You can also use the asynchronous equivalents of SOAP web services list operations. For information about asynchronous operations, see SOAP Web Services Asynchronous Operations. For more information about request processing, see Synchronous Versus Asynchronous Request Processing.

Field Definitions

The SOAP Schema Browser includes definitions for all body fields, sublist fields, search filters, and search joins available to this record. For details, see the SOAP Schema Browser’s time bill reference page.

Note:

For information on using the SOAP Schema Browser, see SOAP Schema Browser.

Usage Notes

Weekly Timesheets

The Weekly Timesheets feature works in conjunction with the Time Tracking feature. For more information on the Weekly Timesheets feature, see Weekly Timesheets.

The TimeBill record used for the Time Tracking feature is supported when the Weekly Timesheets feature is enabled. Each TimeBill instance is a standalone record that belongs to only one TimeSheet instance. The TimeBill record’s read-only RecordRef field, timeSheet references the TimeSheet to which each TimeBill belongs.

When the Weekly Timesheets feature is enabled, each TimeSheet references its related TimeBills in the timeitem sublist. A single TimeSheet can reference multiple TimeBills.

TimeBills are not available currently through the TimeSheet record in SOAP web services. To get all TimeBills for a TimeSheet, use TimeBill search.

The timeSheet field is available to TimeBill searches. You can also use joins for the TimeSheet and TimeBill searches.

Price Field

As of the 2011.2 endpoint, if you create a time bill record with a Price field set to -1, the value of the field is blank, rather than Custom.

Adding a Time Bill

The following code shows how to add a time bill.

C#

          private void addTimeBill()
{
   Console.WriteLine("\nEnter Employee name: ");
 
   // Look for the employee
   EmployeeSearch empSearch = new EmployeeSearch();
   SearchStringField employeeEntityID = new SearchStringField();
   employeeEntityID.@operator = SearchStringFieldOperator.@is;
   employeeEntityID.operatorSpecified = true;
   employeeEntityID.searchValue = Console.ReadLine();
 
   EmployeeSearchBasic empBasic = new EmployeeSearchBasic();
   empBasic.entityId = employeeEntityID;
 
   empSearch.basic = empBasic;
 
   // Run the search 
   SearchResult result = _service.search(empSearch);
 
   if (result.status.isSuccess)
   {
      Console.WriteLine("\nEmployees found: " + result.recordList.Length);
 
      if (result.recordList != null && result.recordList.Length == 1)
      {
         Employee emp = (Employee)result.recordList[0];
 
         Console.WriteLine("\nEmployeeID: " + emp.internalId);
 
         // Instantiate new blank time bill record
         TimeBill timeBill = new TimeBill();
 
         // Instantiate a record object
         timeBill.employee = new RecordRef(); 
         timeBill.employee.type = RecordType.employee;
         timeBill.employee.internalId = emp.internalId;
 
         // Set the date of the time bill to today
         timeBill.tranDate = DateTime.Today;
         Console.WriteLine("\nToday: {0}", timeBill.tranDate);
 
         // Get the amount of hours to add
         timeBill.hours = new Duration();
         Console.WriteLine("\nEnter hours: ");
 
         // Convert the string to a double
         timeBill.hours.timeSpan = Double.Parse(Console.ReadLine());
 
         // Add the record
         WriteResponse response = _service.add(timeBill);
 
         // Display the result of the operation
         if(response.status.isSuccess)
         {
            Console.WriteLine("Record added");
         }
         else
         {
            Console.WriteLine("Record was not added");
         }
      }
      else
      {
         Console.WriteLine("\nSorry - No such Employee");
      }
   }
} 

        

Related Topics

General Notices