Hello, i have a Suitelet that has two buttons doin...
# suitescript
h
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
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
@Anthony OConnor Makes sense, thanks
👍 1
n
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
good call out
🫡 1
h
@Nathan L ohhh you’re right. Thanks for the suggestion