Google Sheets Submit button script won't work for users - google-apps-script

I have a submit button script that I'm using (source: https://www.youtube.com/watch?v=v2X-fArILPA) and it works great when I am signed in, BUT it won't activate when users press the submit button. When I test the form in an incognito browser to simulate a user, I get a red box error that reads "Script Submit experienced an error Details
Dismiss" when I click on the submit button. When I click on "Details" it repeats the message "Script Submit experienced an error" in a new pop up window.
Sharing settings are set to anyone with a link is editor. Certain cells are protected, but not the input cells.
Is there a setting or script that I need to write to allow this script to run for users of the spreadsheet? Thank you in advance!
I've tried using triggers, but they don't allow the user to more than one cell value in before triggering the submit script. I also tried a different script to see if it was perhaps the script itself. Both are doing the same thing.

Related

How to extend "Create with reference" dialog in VA01/02

We would like to extend the "Create with reference" dialog in the transactions VA01 and VA02 with an additional tab.
The functionality is very similar to the tab "Order". When the user clicks on the "Item Selection" button I need to add more data to the next screen.
Is it possible to copy the "Order" tab and adjust it to our requirements?
Addition:
As suggested I started to modify the function group V45C. But as soon as I add the additional tab the programs logic seems to mess up. As soon as the dialog opens I alsways get an error to enter a reference.
It turned out to be quite difficult to debug in that place as I can't enter the function code /h. I assume that the new corresponding fcode is not handled properly so I get this error message.
Do you have any suggestions on where to handle the new fcode and display the dynpro for the tab?
Thanks in advance!

Google script embedded in google sheet adding a menu item

What I tried is adding some functionality to my google sheet (creating events and pushing them to the google calendar). Everything works, but when I close the script editor my menu disappears.
I created the menu items like so:
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Sync to Calendar')
.addItem('Create Events Now', 'CreateEvent')
.addItem('Delete All Events in Calendar', 'DeleteAllEvents')
.addToUi();
}
That works just fine, but I would like to close the script and also when I share the spreadsheet, the member shall be presented with the menu to click and execute the functions. Anyone has a solution how to make that permanent? (without publishing the script which would be an overkill in my opinion)
In some cases OnOpen doesn't run automatically unless the editor has authorized the script. In this case, you need to give editors a way to trigger the script, so they may authorize it, before onOpen will run automatically. You can either give them instructions to do this manually through the script editor, or you can insert a "button" into the sheet.
To do this "button" - insert an drawing into the sheet (the "button"), bind the drawing to your script, and have first time users click the drawing.
In your spreadsheet, click "Insert" -> "Drawing"
Draw a "button" image with useful text for end users ("Show custom menu" or "No menu? Click here!", etc.)
Place the drawing on your spreadsheet in a visible/convenient location.
Click the "three dots" on the drawing and select "Assign Script"
Enter the name of the function (eg OnOpen)
If a user opens the sheet and doesn't see your menu, they can click this "button" to activate the script. They'll be prompted to authorise the script as needed, then the menu will show from that point forward. They should only need to click the button the very first time they open the sheet, unless the scopes change or they manually remove authorization in account settings.
onOpen is a reserved word for a function to be called automatically when a Google Sheets spreadsheet is opened by the spreadsheet owner or editors, it will not run for viewers.
You should check that in the project there isn't any other function named onOpen otherwise another function declaration could be executed instead of the one that you expect.
Reference
https://developers.google.com/apps-scripts/guides/triggers
The suggested answer from Cameron Roberts works as a workaround.
Although in my case the problem was that the script trigger for onOpen was missing. I had to edit the script trigger within the script I wrote. In the script editor go to "Edit" -> "Current projects triggers" and add a trigger for the onOpen function with an event "on open". Apparently that was missing in my case, after that edit, it worked like a charm.

Google Form onFormSubmit not triggering

I have an issue with a google form I am working on. I set up the trigger as seen below.
When the form is submitted an alert box should pop up with information taken from a google sheet.(The form is linked to the sheet)
When I run the code from the script editor it shows the popup in the form, but the trigger never trips when I submit a response to the form.
I have tried:
deleting trigger
creating a new version of the script
adding trigger back
change trigger to TimeDriven and still no trigger
change the script to standalone with the same trigger
Not sure what the issue is since I can execute the code manually.
As Sandy Good states:
A dialog box can't be shown in "View" mode of a Google Form. When you are running the code from the script editor, the pop-up that you are seeing is probably in the "Edit" mode of the Google Form. "On Form Submit" doesn't run from Edit mode. If you are trying to get something to display to the user after they submit the Form, then your only option is the confirmation message: FormApp.getActiveForm().setConfirmationMessage(message)
Using .setConfimrationMessage(message) works for what I want to do. (Give a list of sheet cells when the response of the form is submitted)

Why MS Access pop up form doesn't regain focus after switching apps with Alt-Tab?

I have an Access 2016 application that opens a pop-up form when user double-clicks on a record in a datasheet form. That's meant to be a 'detail form' showing all fields in record (datasheet shows only a few). Now, while editing data on popup form, I switch to another app (say Notepad) to copy some text from there or simply check some other thing. I then switch back to Access app by applying Alt-Tab. However, now focus is over datasheet form, instead of pop up form it was when I first switched to Notepad.
Can anyone please help on understanding why this happens? Ultimately I want to return focus over popup form whenever I switch back from any other app by using Alt-Tab, i.e., maybe by detecting in VBA when Access application gets focus back so I can set focus on desired form. I've read some suggestions about using some Windows API function but no detailed examples on that.
Any help will be greatly appreciated.

Disable submit button in Google Forms?

I'm writing a form and have a multi-select with certain responses (age range); for ranges below a specified value, we redirect users to a page with information on why we don't accept that range currently, etc.
The problem is that the form navigation appears on this page, so they can hit Back (no problem) and Submit (problem).
We don't want users submitting if they wind up on this error-catch page, but I haven't seen any way of disabling or hiding the submit button.
Even checking Google scripts, it doesn't seem like this is possible? Does anyone know if there's a way to do this?
The SUBMIT button either appears on the last page, or on pages where the setting is set to: Submit Form
You probably have the error page as the last page, and the next to last page set to Submit Form.
There is no way to disable the submit button. Put the error page BEFORE the last page. Make the page that is right before the error page skip over the error page and navigate to the last page (Submit Page). On the last page have only one question like: Are you done? "Yes" "No" This way, the user will never see the submit button until they get to that last page. On the Error page, set the page navigation to go to something like back to the first page. If the user clicks BACK on the SUBMIT page, it will skip over the error page and go to the page before it. Of course, the user could navigate back, and change the answer, and get to the SUBMIT page. But then they'd be lying about their age.
You can disable the Google form by accessing Responses tab and unchecking the option Acception responses.
you can use this restrict Data in Google Sheets with Data Validationso it will show a pop up message based on DATA
https://www.howtogeek.com/428919/how-to-restrict-data-input-in-google-sheets-with-data-validation/