script acting on selected records?

Tagged: 

Viewing 4 reply threads
  • Author
    Posts
  • May 10, 2019 at 7:15 AM #34718

    Bert Rietveld
    Participant

    Is it possible to have a script acting on (a few) selected records rather than all or one?
    I’d like to use that for a ‘merge records’ script. The map view is great for seeing that a couple of records are for the same (or close) location even when they have (slightly) different names. I could then select them and merge those records.

    May 10, 2019 at 6:53 PM #34721

    Brendan
    Keymaster

    You can create a Saved Search to filter your records, and then have a Script run against just the found set. But not on arbitrarily selected records.

    May 11, 2019 at 7:08 AM #34731

    Bert Rietveld
    Participant

    Thanks, Brendan! That’ll work. I had thought that it would always run through every record in the database, not just the search results. Good to know!

    May 11, 2019 at 9:19 AM #34732

    Brendan
    Keymaster

    There’s a var mySearch = form.getSearchNamed('My Search Name'); method which will return a search. Then you can call var foundRecords = mySearch.getRecords(); method to retrieve the set of records. Then you can loop through those records and process the records however you like.

    May 11, 2019 at 10:19 AM #34733

    Bert Rietveld
    Participant

    Wow, this is great. And thanks so much for the excellent support!

Viewing 4 reply threads

You must be logged in to reply to this topic.