I need to produce a costed BOM using one of 4 fiel...
# suitescript
r
I need to produce a costed BOM using one of 4 fields based on priority (if one is null, go to the next). I've got assemblies with sub-assemblies many levels deep. Some items have 8000 sub-items. I was thinking a suitelet interface with an MR script that sends an email. I think I might still bump up against governance limitations and also the 10MB email attachment limitation. Am I barking up the wrong tree? Has anyone tried offloading MR logic to a RESTlet? Is there a way I can download to the browser instead of sending an email? I know these are pretty fuzzy requirements, just wondering your thoughts. @mattdahse @alien4u
Input is an item on the Suitelet. Output is a large spreadsheet
c
Can you do the heavy lifting in a query?
a
@reptar Think about approaching this from the bottom up, this is not going to be a single Map Reduce pass considering how many levels deep you need to go(Assembly within Assemblies etc…) you may even consider using multiple Map Reduces. • Define Assemblies components(only non- assemblies) costs and make sure any member of any assembly have a cost defined(updated, whatnot). • Find Assemblies without any other Assembly as a component and update those to have a cost(custom field maybe). • Keep moving up. Again, I don’t think you can pull this off with a single Map Reduce execution, you are going to need one if not multiple Map Reduces, and you may need to monitor governance and re-kick the same Map Reduce from itself. Your report will be also a nightmare if you have to present every single assembly cost including the nested one, only from a visual perspective of how to show the data/report is complex. But still your first pass or Map Reduce is essential, once you have every non-assembly component cost updated then those are re-usable across every single Assembly you need to calculate cost, you will only need to consider components quantities.
thankyou 1
r
Went with a tree data structure. @alien4u
💯 1