I'm setting up an inventory management system to track stock. I have created a spread sheet with 50 columns adding the various different stock we carry. I have added a formula to subtract as the stock becomes used. In a particular cell i have a script and trigger to send me an email once a threshold has been reached.
The problem I'm having is that as I have 50 x script files and 50 x triggers I'm getting the error Too many simultaneous invocations:
below is an example of the scripts I have written, they are all the same but have different cells and message.
function SendEmail1() {
// Fetch the monthly sales
var monthSalesRange =
SpreadsheetApp.getActiveSpreadsheet().getSheetByName("edwards van
stock").getRange("F5");
var monthSales = monthSalesRange.getValue();
var ui = SpreadsheetApp.getUi();
// Check totals sales
if (monthSales < 2){
// Fetch the email address
var emailRange = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Set
Up (do NOT delete)").getRange("B3");
var emailAddress = emailRange.getValues();
// Send Alert Email.
var message = 'FP-C5E-001 ' + monthSales; // Second column
var subject = 'low on stock - place order';
MailApp.sendEmail(emailAddress, subject, message);
}
}
below are my triggers - again all of them the same but different function number.