My Products
Help
Elling Bjåstad
CONTRIBUTOR **

Fetching PDF attachments associated with transactions

by Elling Bjåstad

Hi,

When using generalLedgerTransaction to fetch a list of transactions, if I then want to fetch PDF attachments associated with one of the transactions, afterwards, how do I go about it?

4 REPLIES 4
omelhus
PARTNER

by omelhus (Updated ‎07-03-2024 13:04 by omelhus PARTNER )

It would be helpful if the resolution could be posted here as well.

Accepted solution
Marius Bancila
VISMA

by Marius Bancila

I suppose it can be done in different ways. This is an example, starting from the transaction (but you can also query directly from the mentioned tables):

query purchase_order_line(
  $cid : Int!, 
  $filter :FilterExpression_GeneralLedgerTransaction)
{
  useCompany(no : $cid)
  {   
    generalLedgerTransaction(filter : $filter)
    {
      items
      {
        voucherJournalNo
        auditNo
        
        incomingAccountingDocumentNo
        
        joinup_IncomingAccountingDocument
        {
          incomingAccountingDocumentNo
          incomingAccountingDocumentType          
          
          joindown_IncomingAccountingDocumentAttachment_via_IncomingAccountingDocument
          {
            items
            {
              attachmentNo
              attachmentType
              fileNo
              fileName
              fileData
            }
          }
        }
      }
    }
  }
}

 

by Marius Bancila

I understood this problem was resolved with the support team.

Elling Bjåstad
CONTRIBUTOR **

by Elling Bjåstad (Updated ‎07-03-2024 12:52 by Elling Bjåstad )

Yes, that's correct.

The answer is that attachments can be fetched through incomingAccountingDocument and incomingAccountingDocumentAttachment, using incomingAccountingDocumentNo as the key. This will fetch attachments that are stored directly in the Visma Business NXT database, which is the legacy way of storing attachments. In addition there's a new method for storing file attachments that uses an external file storage service. This method is currently not supported by any customer facing API, says the Visma Business NXT support team.