I am crafting a SuiteScript user event to compute project commission amounts based on Estimates, in advance of sales orders/invoicing transactions. (We compute the real commissions at final invoicing via the incentive sales module, and it's working fairly well.)
This sneak peek will be used by accounting as an early predictor for accruals of commissions; and I can create a periodic saved search to send each sales rep their projected commission amounts.
We have about a 12 different saved searches for commissionable items. In the script I am loading the commissionable item searches so I can extract details. SuiteScript throws:
Error: Unable to determine record type for saved search id {redacted}
I've tried multiple variations of the script type option, including 'commissionableitem', search.Type.SavedSearch, etc. It appears this is a standalone search type, but the documentation for N/search search.load() does not have an obvious entry that refers to a commission search.
Is this standalone search unreachable in code?
I think as a workaround I can create a transaction detail line search that clones the filter of the commissionable item search, but that means more work to maintain.