I am struggling to find a way to add a button to a Suitelet that calls another function in the same suitelet. I have tried many things but I can not get anything to work. I also tried to create a client script and call the client script but the issue with that solution is I need to call another function in the Suitelet from the client script.
function Image(request, response){
var form = nlapiCreateForm("Today's Checks", true);
function next(count){
//code here
showImage(imageId);//call to another function
}
form.addButton('custpage_next','Next',"next();");
response.writePage(form);
showImage(id){
//more code . . .
}
}