'Add submenu inside other submenu in Google Apps Script

So, I'm coding in Google Apps Script, and I neet to make a second level submenu, but everytime I try to add the following code, I get the error from the 2nd image:

var ui = SpreadsheetApp.getUi();
  ui.createMenu('WB_Tools')
    .addSubMenu(ui.createMenu('LE Ready')
      .addSubMenu(ui.createMenu('Generate E-mail'))
        .addItem('SMR', 'WB_Tools.GENERATELESMRREADY')
        .addItem('Non SMR', 'WB_Tools.GENERATELENPIREADY')
      .addSeparator()
      .addItem('Add to SMR/MR Pending tool', 'WB_Tools.ADDPENDINGACT')
      .addItem('Update SMR/MR Dashboard', 'WB_Tools.UPDATEDASHBOARD'))
    .addSeparator()

error

With that, I must show you the line 62 of the file: line 62

So, what should I do to achieve the following:

Global menu

  • First submenu
    • Second submenu
      • Item 1
      • Item 2
    • Item 3
    • Item 4


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source