Team, I am having an issue related to the 10000 li...
# suitescript
a
Team, I am having an issue related to the 10000 limit on sublist records. I am loading a record via suitescript and it only loads 10000 sublist records and my script fails to find the sublist record I am interested in. It seems to load the most recent 10k records, so I am wondering is there is a way to sort the sublist records somehow via suitescript to load the older records first, I have not found a way to do this. One thing that is interesting when manipulating the sublist on the UI is that if you sort by date, it seems that the sublist is reloaded with the different sort order and loads the missing records on the initial load. I am wondering if there a way to mimic this via script. Thanks!
n
Are the sublist records you're talking about "child" records?
b
usually you can use default values to limit the apply sublist to the lines you want
de[ends on which record type you are working with
a
@battk but the default values will find the record within the 10000 records loaded, if you try to find a record that is not on those 10000 records, it will not find it
@NElliott this is in the Invoices sublist on a Deposit Application. It shows there the invoices you can apply the Customer Deposit to
not sure if that is a “child” record
b
use the
invoices
default value to limit which invoices are on the invoices sublist
a
sorry @battk don’t understand what you mean. Remember, I am trying do to this via suitescript, not on the UI
b
record.load has a default value parameter which can be use to initialize the record
in this case limiting the invoices that appears in the invoices sublist
its the same as the ui, default values are represented as url query parameters
a
oh, cool
how can I pass an array of invoices?
b
its an array in suitescript, csv in the url
technically csv string in script as well, but you really should be using an array there to make it clear what you are doing
a
sounds great. I am actually doing a record.transform, but I think the default values work the same, right?
b
in this case yes
most of the time record transforms share the same default values as record load/create
a
cool, I am going to try it now, thanks a lot
works great, thanks a lot @battk
is this invoices parameter documented somewhere?
t
Hello @battk sorry to reuse this thread but I'm having the same issue in a vendor payment. Tried different defaultValues names but all of them failed (bill, bills, invoices). Do you know how this could be achieved? Thanks in advance
a
are you trying to load a customer payment or transform?
t
Transform from Vendor
Also tried from Bill
a
I think on the transform you can use the “invoices” param
e.g. defaultValues: { invoices: loadInvoiceIdArray.toString() },
t
I'm doing this:
let payment = Record.transform({fromType: Record.Type.Vendor, toType: Record.Type.VENDOR_PAYMENT, fromId: 23, defaultValues: {invoices: 6745527}})
And getting this error:
you have entered an invalid default value for this record transformation operation
n
fromType: Record.Type.VENDOR hopefully. Maybe that should be an array despite being a single value for invoices?
t
Yes, VENDOR is in uppercase in my code, sorry
👍 1
If I don't add the defaultValues it creates the payment, but then I can't find the transactions to apply
It didn't work using an array either 🙄
n
I wonder if there are other defaults you need to set too, such as entity / account...
a
okay, for a Vendor Payment I think the params could be “bill” or “vendorbills”
b
run
Copy code
console.log(nsServerCall(nsJSONProxyURL, "getRecordTypes"));
in the console of a page that supports suitescript
to see the list of records and the metadata associated with each
👍 1
a
also keep in mind the Bills must have the same currency as the Vendor Payment
b
pay extra attention to the normal initialized defaults vs the transformed defaults, using record.transform means you pick from the transformed defaults
unlike the deposit application, the vendor payment has differences in default values
👍 2
t
Awesome @battk , where did you get this from?
b
suitescript's client side code uses the nsapiGetRecord function to tell if an operation is supported or not
and if you follow the code in there, you eventually get that function call
😮 1
t
Great! Thanks!