This topic contains 8 replies, has 0 voices, and was last updated by jmessersmith 8 years, 4 months ago.
-
AuthorPosts
-
July 18, 2016 at 3:48 pm #6332
jmessersmithI’m trying to load a saved search. I’ve read in other threads about a bug that happens when your saved search is too complex. I’m wondering if I am hitting that bug and if there is some work around.
My code will return the correct number in the array but all I get is Nulls when I go to read records.
Here is my code, its pretty simple.
Code:
function testsearch(){
var searchresults = nlapiSearchRecord(“transaction”, 2323);
if(searchresults == null)
{
// no results returned by search
}
else
{
for ( var i = 0; searchresults != null && i This is a cached copy. Click here to see the original post. -
July 19, 2016 at 1:51 am #6333
CREECEYou could wrap your nlapiSearchRecord in a try / catch to see if it is throwing an error. The error message may / may not be helpful. You should be able to paste this in the console and run it (may have to refresh a couple of times in Chrome. For some reason it doesn’t always load the nlapi).
-
July 19, 2016 at 3:43 am #6334
j.ji dont see any error in the search code – the error should be in loading the system note record – i dont think you can load a system note record as it is child record of any object in NS and cannot exist without parent. Try loading the NS object and then read the system note sublist.
-
July 19, 2016 at 7:35 am #6335
khultquistcan you copy/paste the results of your nlapiLogExecution
-
July 19, 2016 at 7:47 am #6336
jmessersmithNothing is throwing an error, I just don’t get a result.
the results of nlapiLogExecution is this:
null:null
null:null
null:null
null:null
null:null
null:null
null:null
null:null
null:null
null:null
null:null
null:null
null:null
null:null
null:null
null:null
It returns the same number of lines that exist in the saved search.
-
July 19, 2016 at 8:00 am #6337
al3xiconDoes your search contain grouped results? I’ve found that when that’s the case, result.getId() doesn’t return anything, so I have to explicitly include the grouped internal ID field in the results of the search. Not sure about getRecordType(), but it’s possible that it is suffering the same fate – IF you are grouping.
-
July 19, 2016 at 8:29 am #6338
jmessersmithThe internal ID wasn’t included, I added it but still get the same result.
Here is the criteria
And results:
-
July 19, 2016 at 8:36 am #6339
khultquistal3xicon is right, since you are summarizing/grouping, you have to use a different technique. Try something like this
searchresults[i].getValue(‘internalid’, null, ‘group’);
-
July 19, 2016 at 8:49 am #6340
jmessersmithYup that was it, Thanks guys. Maybe this quirky stuff is fixed in 2.0?
-
AuthorPosts
You must be logged in to reply to this topic.