This topic contains 5 replies, has 0 voices, and was last updated by markjasonflores 7 years, 2 months ago.

  • Author
    Posts
  • #6458 Score: 0

    latchadev
    • Contributions: 0
    • Level 1

    Hello, I have a process that performs a TimeBill search and uses the lastModified field of the SearchDateField type as the search criteria. The search works. Meaning, if someone adds or modifies their time in Netsuite in between two searches, it retrieves those records as expected. But my process checks every 5 minutes and I am noticing in that time span there can be several thousand time bill records that are being returned as modified (and their lastModifiedDate fields are indeed modified since last check). We only have a couple hundred employees and so it seems highly implausible that there could be, for example, 15,000 time records added or updated within five minutes during peak business hours. I am wondering – could there be other activity causing this field to get updated that I’m not aware of? Note – I am using this search technique for other record types and it only brings back a handful as expected. So what is different with the TimeBill ?

    Code:
    class Program
    {
    static void Main(string[] args)
    {
    //search criteria
    SearchDateField searchDateField2 = new SearchDateField();
    searchDateField2.@operator = SearchDateFieldOperator.within;
    searchDateField2.operatorSpecified = true;
    searchDateField2.searchValue = DateTime.SpecifyKind(GetLastCheck(), DateTimeKind.Local);
    searchDateField2.searchValueSpecified = true;
    searchDateField2.searchValue2 = DateTime.Now;
    searchDateField2.searchValue2Specified = true;

    TimeBillSearchBasic searchBasic = new TimeBillSearchBasic();
    searchBasic.lastModified = searchDateField2;
    TimeBillSearch search = new TimeBillSearch();
    search.basic = searchBasic;

    UpdateTimeStamp(); //update last checked
    var timeBills = _service.search(search);

    Console.WriteLine(timeBills.Count()) //could be 10,000 records in 5 minutes
    }

    public static DateTime GetLastCheck()
    {
    //this goes to the database and gets the last time we checked.
    //removed for brevity

    return lastTimeCheck;
    }
    }
    Any insight is appreciated.
    This is a cached copy. Click here to see the original post.

  • #6459 Score: 0

    latchadev
    • Contributions: 0
    • Level 1

    HIiiiii

  • #6460 Score: 0

    Olivier Gagnon NC
    • Contributions: 0
    • Level 1

    The only thing I can think of is that a malformed search criteria is typically ignored by NS (as in, doesn’t give an error, just skips that criteria). So I would say there is something wrong and your criteria is being ignored and the search is returning ALL time entries in the system. 10,000 is just the search page return limit.

  • #6461 Score: 0

    latchadev
    • Contributions: 0
    • Level 1

    Thanks for answering but that’s not it. As I stated, the items it is returning indeed have a modifiedDate that is between two search occurrences – so it’s not as if it’s returning the wrong results. And 10,000 was just an example figure. It varies from 300 to over 10,000 depending on time of day. If it were ALL entries it would be 150,000+. I am thinking that some other user activity/process is modifying this field because there are too many for it to be employees updating their time. Make sense?

  • #6462 Score: 0

    Olivier Gagnon NC
    • Contributions: 0
    • Level 1

    Ah well that is certainly a possibility. I guess you’ll need to look at if you have any scheduled scripts or scheduled workflows (these are often the culprit, nobody ever thinks to look at them!).

  • #6463 Score: 0

    markjasonflores
    • Contributions: 0
    • Level 1

    latchadev

    Can you look into the system notes of the modified timebills and see what has been modified/who modified it/ and under what context?

    I believe Olivier is right — a scheduled workflow/script might be the one changing these.

You must be logged in to reply to this topic.