while setting the sublist value for second search ...
# suitescript
r
while setting the sublist value for second search it throws this error
b
you officially have way too much code for one function
break it up
r
yeah will do
b
the error you are receiving is common if you dont set lines in order
r
but still , should work ?
b
you cant set line 0 and then line 2
you must set line 0, then line 1, then line 2
r
ohh i see
but like is there a way around this?
b
what i recommended, set your lines in order
r
because main line is false and i need only one internal id at a time to display...
in order? on saved search?
b
if you have more results than lines, then you cant use the index of the search result as the line of the sublist
r
i dont get it .. i cant use my search result count?
b
if you dont see the problem, then now is probably the time you need to learn how to use the debugger
r
yeah i do need to...more result than lines?
i do understand the problem
i dont understand why am i not able to setsublistvalue..isnt that the condition i am setting
why does it matter as long as i have condition that meets?
b
what condition are you meeting?
r
see, i have a search that returns some data that data is main line false because condition is of line level whether it exists so i get multiple lines for one internal id and i want that, i just need to display in my suitelet just one line with the internal id and ignore other lines with the same internal id it was cool when i had only one search that met criteria then i created another SO to meet the criteria so it'd show and NOWW..
it is not setting at the start of second SO with different internal id to set it shows me this error\
did i explain that right?
b
im personally not following
r
its just not setting the second search whilst giving me this error ..i just dont understand
b
you only have one search as far as i can tell
not sure what you mean by second search
r
i have one search with 7 searchcount in that search (MAIN LINE FALSE) of which 4 from internal id 2231 and 3 are from internal id 3342 and i just need to display 1 search from 2231 and 1 from 3342 on my suitelet so i create a array check whether the internal id is present and if not setSublistValue and array.push(internalid) for next search count to check if its id is present
why is it invalid sublist operation? i just dont get it
i mean its pretty straight forward what could possibly be the problem
b
i recommend using the debugger
it will help telling you what parameters are used with
Copy code
Sublist.setSublistValue({
  id: "custpage_date",
  line: i,
  value: expectedshipdatee,
});
on a different note, i recommend not capitalizing your variable names
that is traditionally used in javascript to denote an object that should be created using the
new
operator
r
yeah sure ...
its displaying the result once i remove the if else condition ..its weird i dont understand why is this happening
also trying on debugger
thanks got it