Announcement

Collapse
No announcement yet.

pdf document

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • pdf document

    HI,
    I searched the forum, but I couldn't find.
    is there any functional way to create a pdf into a document attached to an entity?

    something like this:
    $createdpdfid = ext\pdf\generate('protocol', entity\attribute('id'), 'protocoltemplate', 'protocol.pdf'
    $createddocid = record\create( 'Document',...
    record\relate('Document', $createddocid, ...
    record\attribute('Document', $createddocid, 'file') = $createdpdfid;

    thank you for help

  • #2
    of course according to variant of second run

    I mean
    if exist named file in linked document, delete record
    or unlink old file from document record and clean all unlinked files on weekly schedule...

    Comment


    • #3
      Hi there,
      Here is the example I made for the Quote entity which works good:
      Code:
      $pdfId = ext\pdf\generate('Quote', entity\attribute('id'), '001', 'protocol.pdf');
      
      record\create(
          'Document',
          'name', 'Protocol PDF',
          'fileId', $pdfId
      );
      Note! It is better to put this logic into some ifThen block to prevent its executing each time you update a Quote record.

      Comment

      Working...
      X