Poll: scripting the search records vs loading the ...
# suitescript
p
Poll: scripting the search records vs loading the saved search records?
m
Scripting for me. I can see the logic of the search in the code, I can add it to version control (SDF for searches is a bit weird to me), search doesn’t get modified or deleted accidentally and I don’t have to name it something weird so others don’t edit it.
✔️ 4
e
^ 100%
t
Depends on the context for me, I am extracting the results of a saved search via a restlet installed from our bundle, for us, this allows the customer to copy and adjust the saved search to meet their needs, without it getting overwritten when we deploy a bundle update, and they can see the results, so they have a first investigation step when things aren't working. This takes the responsibility of maintain and troublesheeting their specifics away from us as a third party integrator and giving it back to the customer.
m
I can get behind that. If you want to give some flexibility to the end-users so you don't have to change code for different scenarios. In this situation, I would use a script parameter to know which script, and maybe add some validation to ensure that the specific columns that the script needs are returned by the search.
e
As with all things, there is a ton of nuance based on the situation, but my default is always to keep the search in code. I am not a SuiteApp distributor, so the vast majority of my experience is in account customization projects. In that capacity, I have found it exceedingly rare that a search needs to both drive code and be flexible for users. It's most likely I would just be providing two separate searches in that instance - one for the users to play with, and one that drives the code. If somehow I did need to provide users the ability to make it flexible, I'd still be ensuring that the code was always adding the columns it needed, regardless of whether those columns were already in the saved search definition.
👍 3
s
Code - but 100% always dev and tinker with saved search until confident is dialed before switching to code. Also have a few use cases where it's very helpful to use saved search-> primarily excluding/including product in 3rd party inventory feeds, or manipulating an inventory 'buffer' etc
😉 1