Auto-Saving Search Results Locally

If you don’t want to set up an FTP server and you do want to save saved search results locally, read on. 

Here are the steps:

  1. Create a saved search that returns less than 10,000 records or 5 Megs. That’s the limit when emailing results.
  2. Set your saved search to send to a recipient with Outlook running on a computer in your network. Sorry… this won’t work with an Exchange rule.
    Email Recipients
  3. Set the email to go out on whatever frequency you like.
    Schedule
  4. Customize the email so that you can identify it when it arrives in outlook as the email you’d like to save attachments.
    Customize
  5. Check out this link to install a macro that runs in Outlook that downloads attachments.
    https://community.spiceworks.com/scripts/show/361-auto-save-attachments-to-folder
    GetTheCode
  6. On the Outlook client that will receive the email from NetSuite, go to
    File >> Options >> Customize Ribbon
    Check the Developer tab
    Developer Tab
  7. Unfortunately, you’ll need to enable all macros.
    Enable Macros
  8. Open Macros by clicking “Visual Basic Editor”
    Open Macros
  9. Paste in the VB code you downloaded in step 5.  You must paste it into the “ThisOutlookSession” object in the left nav.

    Note that I’ve set up my macro to download attachments on any incoming email that has a subject of “Exported ITEMS.” I’m saving the attachment to a network folder. Don’t miss the note to add make sure you have an ending backslash on the path!
    PasteVBcode

  10. Once you close and save this macro, close and re-open Outlook.
  11. To test, I simply ran my saved search. Emailed it to myself using the Email icon on the search results. When the email arrived, I changed the subject to “Exported ITEMS” and forwarded it to myself. I checked the network folder and my search results were there.
  12. The next step for me would be to create a job in my SQL server to auto-import the results into a table in my database.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s