Our company is looking to generate customized cust...
# suitescript
r
Our company is looking to generate customized customer statement at the end of month as PDF and email them to customer. there are approximately 30000 customers and will be growing in the future. Here are the possible NS ways to generate these 30000 customer statements and possible advantages and disadvantages 1) write map reduce script to generate these statements Advantage: data is in NS Disadvantage: script will be running for long hours and will block other higher priorities schedule and map reduce scripts 2) build a restlet Advantage: lightweight and user will get the data as Json and they can manipulate the data in their environment Disadvantage: restlet script usage limitation and json output size (10 mb) Suitetalk: Advantage: user can request whatever they want and can manipulate the data Disadvantage: no one in our company knows how to build integration using suitetalk apis Please provide your thoughts about what do you think is best approach for this case
m
@rajneesh kumar we send about 1,500 statements using a Map/Reduce. The script also renders and attaches unpaid invoices (if there are 5 or less) to the email. With a concurrency limit of 1, it took 1h 20 to run minutes last month. I imagine that if you are running purely statements and have a SuiteCloud+ limit you can get your statement run down to a couple off-peak hours
b
These advantages and disadvantages dont look well thought out
Map reduce looks reasonable
Restlet is unreasonable unless something generates http requests for each customer
Suitetalk could work if you have your own setup to generate emails and pdfs. Im not sure why its considered if nobody knows how to use it
m
Another option you could consider is a scheduled workflow. It won't get the concurrency of a M/R so it would take much longer - but I think it's a separate queue so it wouldn't take away concurrency from your other scripts
We used to do our statement runs with a workflow and only changed to a M/R so that we could attach invoices with the statements
r
@battk @michoel Idea is requester will call restlet with array of external ids of NS custom record (we have external id for custom record when it gets created into NS from external application) and Restlet will return JSON data with open invoices and bills for each external id and requester can process the data at their end and can generate pdfs and send emails and can also store pdfs at external storage.
b
If the requestor is not you, and you can make the requestor email and pdf
You should do the restlet if you think the requestor can do the work
r
@battk yes requester will generate email and pdf
m
@Zoran Roncevic