Status Update
Comments
bl...@google.com <bl...@google.com> #2
an...@scorchsoft.com <an...@scorchsoft.com> #3
an...@scorchsoft.com <an...@scorchsoft.com> #4
I also experience this issue. If I add an eSig field, any eSig field, then any attempt to open the google doc in a google script, it fails.
If I then delete the eSignature fields from the document and save, then the script can immediately access the file again by ID.
Here is the error I get for reference:
4:32:57 PM Error
Exception: Unexpected error while getting the method or property openById on object DocumentApp
(anonymous) @ Code.gs:91
scriptname @ Code.gs:63
an...@scorchsoft.com <an...@scorchsoft.com> #5
I'd just like to add to this ticket that a key use case we are looking forward to once this is fixed is to be able to create a template document which we can programmatically replicate for new customer agreements. I raise this to ensure that the API endpoints for manipulating docs aren't also broken once loaded.
Example:
var doc = DriveApp.getFileById(templateToLoadID).makeCopy(customFileName, generatedNdasFolder);
Note that documents will be accessed using either DriveApp or DocumentApp parent classes, so it's important both of these function and aren't susceptible to the above bug.
note how in this code we load via one and manipulate via the other due to the availability of API calls to implement the above use case:
//re-open the doc using DocumentApp due to saveandclose function being available
var doc = DocumentApp.openById(doc.getId());
var docBody = DocumentApp.openById(doc.getId()).getBody();
// Replace placeholders in the document (this is a custom function just as an example)
replacePlaceholders(docBody, row, varsMap[row[COL_AGENT_NAME]], contractDate);
//Save and close to commit the change
doc.saveAndClose();
jp...@google.com <jp...@google.com> #6
I have reported this to the engineering team and future updates will be shared here. Thank you for your patience.
pw...@grackledocs.com <pw...@grackledocs.com> #7
de...@ibo.app <de...@ibo.app> #8
so...@gmail.com <so...@gmail.com> #9
wi...@happystl.com <wi...@happystl.com> #10
wo...@plu.edu <wo...@plu.edu> #11
jp...@google.com <jp...@google.com> #12
I am marking this issue as FIXED
as the internally reported issue has been marked as FIXED
. Please note that there may be a delay in rolling this out to production. Thank you for your patience and please comment here if the issue remains.
al...@gmail.com <al...@gmail.com> #13
Thanks in advance!
jp...@google.com <jp...@google.com> #14
It's typically about 2 weeks but can be longer if there is more extensive testing going on as part of the rollout.
Description
A short description of the issue:
Trying to call
DocumentApp.openById
on Google Docs having eSignature fields leads to an exception:Exception: Unexpected error while getting the method or property getActiveDocument on object DocumentApp.
Reproduce the issue
Expected result: The script should run with no error / exception
Current result: Exception is raised:
Exception: Unexpected error while getting the method or property getActiveDocument on object DocumentApp.
(see attached screenshot)Additional information
The script as-is makes no sense, but my use-case is Google Docs generation from a Google Sheets document (database) from a given Google Docs template. Currently, the generated document is printed for signature: the issue appeared when adding eSignature fields to get rid of the manual signature.