Save generated PDF to a specified Document Folder

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1605

    Save generated PDF to a specified Document Folder

    I generate a PDF by formula and want to save it right away into a previousliy created Folder. I succeed in saving it to the Documents, bit it won`t get into the folder I specified. Here is my formula to create the record in Documents:

    Code:
    record\create(
    'Document',
    'type', 'myDocument',
    'categoryId','67617422acca98140', //ID of the Folder
    'name', 'myDocumentsName',
    'fileId', $pdfId
    );
    It does not work with the name "categoryId" and also not with "folder" or "DocumentFolder".
  • yuri
    Member
    • Mar 2014
    • 8451

    #2
    I believe you need to use 'folderId' instead.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment


    • shalmaxb
      shalmaxb commented
      Editing a comment
      Thanks, yuri, that was it. Has to be folderId
  • yuri
    Member
    • Mar 2014
    • 8451

    #3
    Note that you need also to set the 'field' attribute in the Attachment record. It should be set to 'file' in your case.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    Working...