I'm trying to use a button to redirect to suitelet...
# suitescript
r
I'm trying to use a button to redirect to suitelet/self. I want to pass a field to update the data being displayed. It doesn't appear to call the function specified by functionName. I've done this before but I can't find any examples.
Copy code
function GET(context) {
    try {
        var form = getForm(context);
        var data = getData();
        showResults(form, data);
        form.addButton({id: 'custpage_update_file', label: 'Update File', functionName: 'redirectToSuitelet'});
        context.response.writePage({pageObject: form});
    } catch (e) {
        log.error('GET', e);
    }
}

function redirectToSuitelet() {
    log.debug('redirect', 'toSuitelet');
}
Button click -> no logs.
c
Is the GET function being called?
You've got quite a lot in your try statement?
r
Yes. Do I have to specify a client script for functionName?
The button displays but nothing happens on click.
c
Untitled
r
I've done a lot of UE->client->Suitelet->MR. A client script is needed to define the function from functionName and I think that answers my question. It just seems strange that this is needed. The submit button doesn't need any client side handling.