Hello, i have a Suitelet that has two buttons doing two different things. How do I attach each button to a separate Map/Reduce script ? TIA
a
Anthony OConnor
03/23/2023, 9:59 PM
the suitelet buttons call a function in a client script module you attach to the form. (form.clientModulePath no script record required for the client script)
so you'd have two different functions in your client script, 1 function calls MR A and the other one calls MR B.
h
Helena
03/23/2023, 10:27 PM
@Anthony OConnor Makes sense, thanks
👍 1
n
Nathan L
03/24/2023, 12:10 AM
Keep in mind that you can only trigger the MR script from another server side script. So you can't actually call the MR from a client script.
But you can have the client script reload the page with a parameter or something like that. Then have the suitelet check for that paramter and schedule the MR with the N/Task module.
👍 3
a
Anthony OConnor
03/24/2023, 12:22 AM
good call out
🫡 1
h
Helena
03/24/2023, 12:40 AM
@Nathan L ohhh you’re right. Thanks for the suggestion