This topic contains 0 replies, has 0 voices, and was last updated by Nick Foster 9 years, 3 months ago.

  • Author
    Posts
  • #6904

    Nick Foster

    I’ve been tasked with creating partial timesheets for users with data from a third party system. In order to do this I need to search for existing time sheets for a particular user to see if they already exist and then see if I can add time to the timesheet.

    I have managed a simple search which has returned my previously created timesheet but it has not brought with it the existing TimeEntry records. The timeGridList field is null.

    Code:
    public void GetTimesheet() {

    // find me
    var usr = GetEmployee(122);
    var usrId = usr.internalId;

    RecordRef usrRef = new RecordRef() {
    internalId = usrId,
    type = RecordType.employee,
    typeSpecified = true
    };

    // look for timesheets
    TimeSheetSearchBasic tssb = new TimeSheetSearchBasic() {
    employee = new SearchMultiSelectField() {
    @operator = SearchMultiSelectFieldOperator.anyOf,
    operatorSpecified = true,
    searchValue = new RecordRef[] { usrRef }
    }
    };

    SearchResult searchResult = _service.search(tssb);

    // do something here…

    }
    Do I need to do a different type of search to retrieve the time entry records with the timesheet?

    Thanks,

    Nick
    This is a cached copy. Click here to see the original post.

You must be logged in to reply to this topic.