We are encountering an issue when there are more t...
# suitescript
k
We are encountering an issue when there are more than 10,000 open vendor bills for a single vendor. When I attempt to apply a vendor prepayment using a vendor prepayment application or vendor credit to a vendor bill, the apply sublist of the vendor credit or vendor prepayment application transaction will only have the first 10,000 vendor bills. For example, when I execute the SuiteScript
Record.getLineCount({fieldId: 'apply'})
on a vendor credit, it returns 10,000 when there are more that 10,000 open vendor bills. Has anyone found a workaround or solution for working with more than the 10,000 sublist limit? Is there a way to filter the sublist in SuiteScript 2.x?
a
hmm can you use
Record.findSublistLineWithValue
, to return a line number that you can then use to set apply = true? no idea if it will work if the line isn't in the first 10,000 lines though might just return -1 for not found
honestly though, and I know this isn't what you want to hear... why the hell do you have 10,000 OPEN bills for a single vendor !?
😂 1
k
@Anthony OConnor, I am using
Record.findSublistLineWithValue
now to find lines. If the vendor bill is not in the first 10,000, it returns -1.
👍 1
That’s a client question. It’s the nature of their business. We actually have two clients that have this issue.
In the NetSuite UI, the apply sublist can be customized to add a filter to reduce the number of lines in the sublist, but this functionality doesn’t exist in SuiteScript (I haven’t found it.)
a
okay, so then that's how they're doing it in the UI? is there a predefined filter that they have? like date = this month or something?
cos maybe if you load in dynamic mode, and set a the custom form appropriately to have that filter defaulted... then maybe that will auto filter your list too?
k
On the sublist tab, you can select the Customize button, which shows a screen where you can select one or more filter criteria. These then appear as fields on the sublist tab.
Interesting idea. Unfortunately, I can not use a pre-defined filter.
I need to be able to tell the record to filter the sublist by specific value then search the sublist for the bill.
When you use Dynamic mode, are you working with a specific form?
a
yeah.. once you set it
k
Where do you set the form?
Is it in script or is it the preferred form?
a
record setValue customform = custform1234
i think it defaults to the preferred and you can overwrite
k
interesting
very interesting.
a
maybe there's something to explore there? I'm not hopeful though tbh, this all sounds kind of insane 😂
k
Thank you. I like insane. Most of what I have to do to work around NetSuite’s hard limitations is insane 😄
a
i mean this is true, this is why we get paid 😉
i don't think the workaround is that insane... the client situation definitely seems insane to me... can you divulge the client industry at least? it seems VERY strange to me
k
Shipping / Freight forwarding industry
a
ahhh yeah okay, I can see that
b
for your vendor credit, you can use the
vendorbills
default value to limit the lines in the apply sublist
i dont think there is an equivalent for vendor prepayment applications
k
@battk, what do you mean by
vendorbills
default value?
b
default values are also query parameters that can be used in the url of a record, so you can see what effect the default value has in the ui
k
Thanks. I will give it a try.