Okay so I got the Saved Search to work properly (thank you for the reference of the "When Ordered By" function!), but I'm stuck on the part now of actually getting that value from the search to populate into the custom field.
- Unfortunately, it looks like I can't utilize the "Summary Search Derived Values" option in Custom Item Fields as per this NetSuite article: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_3746191995.html
Where it shows the only available Custom Field Types that can derive values from Summary Saved Searches are:
Entity Fields
CRM Fields
Transaction Body Fields
Other Record Fields
Custom Record Custom Fields
And I need either a custom Item field or custom Transaction Line Field to be able to associate the "Last Purchase Vendor" on an item-by-item basis.
-So I'm back to needing to use some other method to fill the Custom Item Field value. Any ideas?
CASE WHEN {type}='Inventory Item’ THEN (CASE WHEN {transaction.type}=‘Item Receipt’ THEN (CASE WHEN {transaction.mainline}=‘F’ THEN (CASE WHEN {transaction.createdfrom} LIKE ‘Purchase Order’) THEN (KEEP(DENSE_RANK LAST {transaction.entity} WITHIN GROUP (ORDER BY {transaction.trandate}))) ELSE ‘null’ END) ELSE ‘null’ END) ELSE ‘null’ END) ELSE ‘null’ END)