Hi everyone, I am looking to add two fields to the...
# general
a
Hi everyone, I am looking to add two fields to the Credit Memo PDF. The first is they want the customer payment information, so if a payment was applied to a credit memo, they want the payment information displayed. The second is they want the invoice associated with a credit memo, which is a lot more straightforward. I cannot seem to wrap my head around the relationship between a payment and a credit memo however and any guidance would be appreciated
l
money in, so -> inv -> payment money out, inv -> rma -> credit memo
a
so to get the payment info on the CM, I'd need to go RMA to Inv to Payment? I'm guessing that's a script solution to set that field versus a query type field?
l
i dont' think you can source the payment record info from credit memo. they don't directly relate. also there maybe more than one payments of different methods applied to original invoice.
c
it needs to be a custom advanced pdf and scripted from the sound of it
a
Yes I was worried about the cardinality of the relationships as well. hmm, this is great information, thank you.
l
does adv. pdf allow injecting a piece of suitescript js code? say a search, then parse the result inline?
c
nope
l
how about calling an external code file and get json data? guess not
a
I was thinking a script on CM that looks up the data and stores it on the record itself, then just pulling from that
c
if you were gonna go that far i'd just do a custom advanced PDF and pass in whatever data you need
if you can get the info onto the credit memo record you can update your data and pull it into the native pdf
l
@creece how to "pass in" data into adv. pdf?
a
Ue script on print context and adding data to a server widget, then pulling from that in the adv. pdf is how I've done it before, not sure if that's how everyone else has done it though
a
In my case I think they want it stored on the UI as well though, so I'm thinking if we can pull it into the CM record and save it that'd be best
l
UE before load on CM, query related payments, store in a hidden variable. adv. pdf can reference it. that sounds about right
a
Cool. I'll give that a shot. Thank you both!
l
learned something new myself
🙌 1
c
you can store it as json and parse it out as well
1