Does anyone know how to access the `credits` list ...
# suitescript
m
Does anyone know how to access the
credits
list of a customer payment via suitescript (or even a saved search)?
It's under Apply but it's the 'Credits Applied'... I don't know, sublist type thing (since I assume Apply is the 'proper' sublist but when I query that I'm only seeing the 'Applied To' list/values
when i pull up the record and convert to json the only sublist I see with records is the apply one, but it only has the Applied To records
b
depends on when you need to get it, that credits sublist is only available on view or create
and if you are trying to get it for an existing payment, there is only view, which is really hard to get outside of a payment viewed in the ui on the beforeLoad
m
Yeah chatgpt said it's not accessible, one of my coworkers eventually figured out a strange hacky saved search that seems to work
Untitled
b
saved searches can get you the credits applied to the invoice of the customer payment
so if you dont need to deal with invoices with multiple payments/refunds, then that may be good enough
m
In my case they're all journals, not invoices or credits
b
same answer, take a look at the applied to transaction on the journal
its applied to the invoice or whatever other transaction its applied to , not the customer payment
m
Right but I need the customer payment unfortunately. There are no invoices or credits. The customer payment is applying journals to journals
So I need to find all the journals on the customer payment, apply and credit side and then delete the customer payment and re-save all the journals to unapply everything. But I want to do it from a saved search b/c I don't know how many customer payments need to be deleted (trying to find customer payment with the aracct of 1721, which seems to be another impossible field to query)
Doing this for just the apply side is pretty simple, it's just getting the journals used as credits that's proving to be very difficult
b
it doesnt actually sound like you care which jouurnal entry is connected to each customer payment
m
I don't care in particular other than i only want customer payments and journal entries related to a specific ar account
i ended up with this monstrosity...
Basically 2 searches in one with the OR