Bumped by Community user
    Bumped by Community user
3 deleted 1 character in body
source | link

Anyone know why this caused The script does not have permission to get the active user's identity.?

I don't have any functions that asks for the user identity. So I'm a little confused.

function onEdit1onEdit(e) {

    if (e.range.getA1Notation() == 'D5' || e.range.getA1Notation() == 'E5' || e.range.getA1Notation() == 'F5') {

        var range = e.range;
      var now = new Date();
        var time1 = Utilities.formatDate(new Date(now.getTime()), "GMT-8","E M/d/yy h:mm:ss a");
        range.setNote('Please wait 15 sec for total calculation in Notes to complete.' + String.fromCharCode(10) + String.fromCharCode(10) + 'Last modified: '  + String.fromCharCode(10) + time1 + ' PST');

        var sheetUS = SpreadsheetApp.getActive().getSheetByName('US');
        var principle = range.getValues();
        var rownum = sheetUS.getRange("N1").getValues();
        var term = sheetUS.getRange("C7:C" + rownum).getValues();

        if (e.range.getA1Notation() == 'D5') {
            var payment = sheetUS.getRange("D7:D" + rownum).getValues();
            for (var i = 0; i < term.length; i++) {
                var total = term[i] * payment[i];
                var totalinterest = term[i] * payment[i] - principle;
                sheetUS.getRange(i + 7, 4).setNote(
                  'Total Loan Interest: $' + comma(totalinterest.toFixed(2)) + String.fromCharCode(10) + String.fromCharCode(10) +
                  'Total Payment: $' + comma(total.toFixed(2)) 
                );

            }
        } 
}

Anyone know why this caused The script does not have permission to get the active user's identity.?

I don't have any functions that asks for the user identity. So I'm a little confused.

function onEdit1(e) {

    if (e.range.getA1Notation() == 'D5' || e.range.getA1Notation() == 'E5' || e.range.getA1Notation() == 'F5') {

        var range = e.range;
      var now = new Date();
        var time1 = Utilities.formatDate(new Date(now.getTime()), "GMT-8","E M/d/yy h:mm:ss a");
        range.setNote('Please wait 15 sec for total calculation in Notes to complete.' + String.fromCharCode(10) + String.fromCharCode(10) + 'Last modified: '  + String.fromCharCode(10) + time1 + ' PST');

        var sheetUS = SpreadsheetApp.getActive().getSheetByName('US');
        var principle = range.getValues();
        var rownum = sheetUS.getRange("N1").getValues();
        var term = sheetUS.getRange("C7:C" + rownum).getValues();

        if (e.range.getA1Notation() == 'D5') {
            var payment = sheetUS.getRange("D7:D" + rownum).getValues();
            for (var i = 0; i < term.length; i++) {
                var total = term[i] * payment[i];
                var totalinterest = term[i] * payment[i] - principle;
                sheetUS.getRange(i + 7, 4).setNote(
                  'Total Loan Interest: $' + comma(totalinterest.toFixed(2)) + String.fromCharCode(10) + String.fromCharCode(10) +
                  'Total Payment: $' + comma(total.toFixed(2)) 
                );

            }
        } 
}

Anyone know why this caused The script does not have permission to get the active user's identity.?

I don't have any functions that asks for the user identity. So I'm a little confused.

function onEdit(e) {

    if (e.range.getA1Notation() == 'D5' || e.range.getA1Notation() == 'E5' || e.range.getA1Notation() == 'F5') {

        var range = e.range;
      var now = new Date();
        var time1 = Utilities.formatDate(new Date(now.getTime()), "GMT-8","E M/d/yy h:mm:ss a");
        range.setNote('Please wait 15 sec for total calculation in Notes to complete.' + String.fromCharCode(10) + String.fromCharCode(10) + 'Last modified: '  + String.fromCharCode(10) + time1 + ' PST');

        var sheetUS = SpreadsheetApp.getActive().getSheetByName('US');
        var principle = range.getValues();
        var rownum = sheetUS.getRange("N1").getValues();
        var term = sheetUS.getRange("C7:C" + rownum).getValues();

        if (e.range.getA1Notation() == 'D5') {
            var payment = sheetUS.getRange("D7:D" + rownum).getValues();
            for (var i = 0; i < term.length; i++) {
                var total = term[i] * payment[i];
                var totalinterest = term[i] * payment[i] - principle;
                sheetUS.getRange(i + 7, 4).setNote(
                  'Total Loan Interest: $' + comma(totalinterest.toFixed(2)) + String.fromCharCode(10) + String.fromCharCode(10) +
                  'Total Payment: $' + comma(total.toFixed(2)) 
                );

            }
        } 
}
2 edited tags
| link
1
source | link

The script does not have permission to get the active user's identity

Anyone know why this caused The script does not have permission to get the active user's identity.?

I don't have any functions that asks for the user identity. So I'm a little confused.

function onEdit1(e) {

    if (e.range.getA1Notation() == 'D5' || e.range.getA1Notation() == 'E5' || e.range.getA1Notation() == 'F5') {

        var range = e.range;
      var now = new Date();
        var time1 = Utilities.formatDate(new Date(now.getTime()), "GMT-8","E M/d/yy h:mm:ss a");
        range.setNote('Please wait 15 sec for total calculation in Notes to complete.' + String.fromCharCode(10) + String.fromCharCode(10) + 'Last modified: '  + String.fromCharCode(10) + time1 + ' PST');

        var sheetUS = SpreadsheetApp.getActive().getSheetByName('US');
        var principle = range.getValues();
        var rownum = sheetUS.getRange("N1").getValues();
        var term = sheetUS.getRange("C7:C" + rownum).getValues();

        if (e.range.getA1Notation() == 'D5') {
            var payment = sheetUS.getRange("D7:D" + rownum).getValues();
            for (var i = 0; i < term.length; i++) {
                var total = term[i] * payment[i];
                var totalinterest = term[i] * payment[i] - principle;
                sheetUS.getRange(i + 7, 4).setNote(
                  'Total Loan Interest: $' + comma(totalinterest.toFixed(2)) + String.fromCharCode(10) + String.fromCharCode(10) +
                  'Total Payment: $' + comma(total.toFixed(2)) 
                );

            }
        } 
}