This topic contains 5 replies, has 0 voices, and was last updated by markjasonflores 7 years, 8 months ago.
-
AuthorPosts
-
February 28, 2017 at 2:12 pm #6458
latchadevHello, 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 brevityreturn lastTimeCheck;
}
}
Any insight is appreciated.
This is a cached copy. Click here to see the original post. -
March 1, 2017 at 7:00 am #6459
latchadevHIiiiii
-
March 1, 2017 at 7:58 am #6460
Olivier Gagnon NCThe 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.
-
March 1, 2017 at 1:16 pm #6461
latchadevThanks 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?
-
March 2, 2017 at 5:13 am #6462
Olivier Gagnon NCAh 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!).
-
March 7, 2017 at 1:34 pm #6463
markjasonfloreslatchadev
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.
-
AuthorPosts
You must be logged in to reply to this topic.