Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion markdownpages/profit/en/howto-bijlage-dossier.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
author: CLN
date: 2025-11-08
date: 2026-06-22
tags: Tutorial, GetConnector, UpdateConnector, AppConnector, Authentication, Authorization
title: Retrieving attachments from AFAS Profit
---
Expand All @@ -9,6 +9,8 @@ title: Retrieving attachments from AFAS Profit

Through the dossier functionality, it is possible to save files as attachments to an employee/person/organization dossier. This ensures that you have all the data together and can easily find it again. Sometimes it is necessary to retrieve these files from the environment. In this How-To, you will learn exactly How-To do this.

> This article is about how to do this yourself, if you have sufficient programming knowledge. Have you agreed that the AFAS Systemintegrators team will do this for you? [Read here which actions are expected from you](./howto-export-subject-attachments).

## What you need

- AFAS Environment
Expand Down
120 changes: 120 additions & 0 deletions markdownpages/profit/en/howto-export-subject-attachments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
author: EZW
date: 2026-06-22
tags: GetConnector, UpdateConnector, AppConnector, Authentication
title: Exporting dossier attachments from AFAS Profit via Systemintegrators
---

## Introduction

Using dossier functionality, you can save files as attachments on the dossier of an employee/person/organization. This ensures all data is kept together and easy to find. Sometimes you may want to retrieve these files from your environment. In this How-To, you can read exactly which actions are expected from you when you have agreed that the AFAS Systemintegrators team will do this for you.


## What you need

- AFAS environment
- Rights to create GetConnectors and AppConnectors
- Rights in the authorization tool to grant rights to a token


## End result

After completing the steps in this How-To, the Systemintegrators team will deliver an export of the attachments of the dossier items. The attachments are delivered in a zip file. This zip file contains a folder structure that is determined by the first (top) fields of the GetConnector. All other fields that you add to the GetConnector are included in a csv file. This allows you to make the end result as complete as possible.


## 1. Create a GetConnector to retrieve dossier items

Create a GetConnector that retrieves the dossier items for which you want to export attachments. This GetConnector determines what the end result will look like. For this GetConnector, you can use <a href="../../../media/Dossierexport.gcn" download>this GetConnector</a> as a base.

### 1.1 Name of the GetConnector

This GetConnector must always have the following name: `Dossierexport`.

### 1.2 Structure of the GetConnector

The GetConnector must contain the following fields:
- **Folder structure**
- **DossieritemId**
- **Content of the csv file**

_In other words_: the GetConnector must always contain a field named `DossieritemId`. All fields before it (the top fields) determine the folder structure of the end result. All fields after it are included in a csv file.
The folder structure and the content of the csv file are delivered together in a zip file.

#### 1.2.1 Folder structure

The attachments are delivered in a zip file. This zip file contains a folder structure that is determined by the first (top) fields of the GetConnector. In <a href="../../../media/Dossierexport.gcn" download>this example GetConnector</a>, these are the fields `Subject type (description)` and `Employee code`, so the folder structure becomes `Subject type (description) > Employee code`. For example: `Payslip (Profit)\EZW`.

#### 1.2.2 DossieritemId

Make sure this field is named `DossieritemId`. The value of this field must match the field `DossieritemId`.

#### 1.2.3 Content of the csv file

The csv file always contains the DossieritemId field, so you know which attachments belong to which dossier item. It also contains a field named `Bestandsnaam`, which contains the attachment file name including the folder structure.
All other fields you add to the GetConnector are also included in the csv file. So make sure you add all relevant information to the GetConnector. This can be the name of the dossier item, the date it was added, and so on. Custom fields you created yourself can be added here as well. This allows you to make the end result as complete as possible. In <a href="../../../media/Dossierexport.gcn" download>this example GetConnector</a>, these are the fields
- Description
- Submission date
- Characteristic value 1
- Characteristic value 2
- Purchase relation number
- Administration (purchase invoice)
- Purchase invoice number
- Invoice amount (purchase invoice)
- Sales relation number
- Administration (sales invoice)
- Sales invoice number
- Invoice amount (sales invoice)

You will rarely need exactly these fields, but hopefully this gives you an idea of the possibilities.

### 1.3 Filtering

Make sure you filter the GetConnector on the dossier items whose attachments you want to export. So if you only want to export payslip attachments, filter on dossier item type `-2` (Payslip). This filter works just like in a regular view in Profit, so you can also filter on multiple values or apply other filters.

In the GetConnector screen, verify that the filter is applied correctly by clicking "Preview".


## 2. Create an AppConnector

Create an AppConnector. The name is not relevant, but for this example you can use `Export dossier attachments`.

Use the following settings in step 1:
- **Authentication type**: Classic token
- **Automatically generate token**: Yes
- **User group**: Create new user group based on AppConnector name
- **User**: Create new user based on AppConnector name

### 2.1 GetConnectors

This AppConnector needs two GetConnectors.

#### 2.1.1 Dossierexport

This GetConnector is the GetConnector you created in step 1. This GetConnector retrieves the dossier items for which you want to export attachments. Make sure the name is exactly `Dossierexport`, so the Systemintegrators team can recognize it.

#### 2.1.2 Profit_Subject_Attachments

This GetConnector retrieves the attachments of dossier items. This is a standard GetConnector that is already available in the environment: [Profit_Subject_Attachments](../../../OpenApiSpecs/profit/en/Dossiers%20en%20bijlagen%20en%20workflows#get-/connectors/Profit_Subject_Attachments).

### 2.2 Custom connectors

#### 2.2.1 SubjectConnector

Add the SubjectConnector. This connector is needed to retrieve the attachments of dossier items. In the Connectors tab, click `New` and select `AppConnectorSubject`.


## 3. Create a token

Create a token and grant the following rights in the authorization tool:
- Rights to execute the GetConnector from step 1 via `General > Management > Definition > Filters > General - Execute definition (incl. report, analysis, document)`. If you did not enter a Definition group or category, you can skip this step.
- Rights to the correct dossier items via `CRM > Dossier > Dossier items > Filters`.


## 4. Provide the token to the Systemintegrators team

Preferably do this in a secure way, for example through the request in the customer portal, or via a secure email. The Systemintegrators team can then use this token to execute the GetConnectors and export the attachments.


## 5. Receive the zip file with attachments

The zip file will be available through a secure link that can be used once and has limited validity. The Systemintegrators team will provide this link through the request in the customer portal.
6 changes: 4 additions & 2 deletions markdownpages/profit/nl/howto-bijlage-dossier.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
---
author: CLN
date: 2025-11-08
tags: Tutorial, GetConnector, UpdateConnector, AppConnector, Authentication, Hr
date: 2026-06-22
tags: Tutorial, GetConnector, UpdateConnector, AppConnector, Authentication
title: Ophalen van bijlagen uit AFAS Profit
---

## Inleiding

Via de dossier functionaliteit is het mogelijk om bestanden als bijlage op een dossier van een medewerker/persoon/organisatie vast te leggen. Hiermee zorg je ervoor dat je alle gegevens bij elkaar hebt staan en makkelijk terug kan vinden. Soms komt het voor dat je deze bestanden uit de omgeving wilt halen. In deze How-To lees je precies hoe je dit doet.

> Dit artikel gaat over hoe je dit zelf kan doen, als je voldoende programmeerkennis hebt. Heb je afgesproken dat het team Systemintegrators van AFAS dit voor je doet? [Lees dan hier welke acties er van jou verwacht worden](./howto-export-subject-attachments).

## Wat heb je nodig

- AFAS Omgeving
Expand Down
120 changes: 120 additions & 0 deletions markdownpages/profit/nl/howto-export-subject-attachments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
author: EZW
date: 2026-06-22
tags: GetConnector, UpdateConnector, AppConnector, Authentication
title: Dossierbijlagen uit AFAS Profit laten exporteren door Systemintegrators
---

## Inleiding

Via de dossierfunctionaliteit is het mogelijk om bestanden als bijlage op een dossier van een medewerker/persoon/organisatie vast te leggen. Hiermee zorg je ervoor dat je alle gegevens bij elkaar hebt staan en makkelijk terug kan vinden. Soms komt het voor dat je deze bestanden uit de omgeving wilt halen. In deze How-To lees je precies welke acties er van jou verwacht worden als je hebt afgesproken dat het team Systemintegrators van AFAS dit voor je doet.


## Wat heb je nodig

- AFAS Omgeving
- Rechten op aanmaken van GetConnectoren en AppConnectoren
- Rechten op de autorisatietool om rechten toe te kennen aan een token


## Eindresultaat

Na het uitvoeren van de stappen in deze How-To zal het team Systemintegrators een export van de bijlagen van de dossieritems aanleveren. De bijlagen worden in een zip-bestand aangeleverd. In dit zip-bestand zit een mappenstructuur die bepaald wordt door de eerste (bovenste) velden van de GetConnector. Alle overige velden die je toevoegt aan de GetConnector worden opgenomen in een csv bestand. Zo maak je je eindresultaat zo compleet mogelijk.


## 1. Maak een GetConnector aan voor het ophalen van de dossieritems

Maak een GetConnector aan die de dossieritems ophaalt waarvan je de bijlagen wilt exporteren. Deze GetConnector bepaalt hoe het eindresultaat eruit komt te zien. Gebruik als basis voor deze GetConnector bijvoorbeeld <a href="../../../media/Dossierexport.gcn" download>deze GetConnector</a>.

### 1.1 Naam van de GetConnector

Deze GetConnector moet altijd de volgende naam hebben: `Dossierexport`.

### 1.2 Opbouw van de GetConnector

De GetConnector moet de volgende velden bevatten:
- **Mappenstructuur**
- **DossieritemId**
- **Inhoud van het csv bestand**

_Anders gezegd_: de GetConnector moet altijd een veld `DossieritemId` bevatten. Alle velden die ervóór staan (de bovenste velden) bepalen de mappenstructuur van het eindresultaat. Alle velden die erna komen worden opgenomen in een csv bestand.
De mappenstructuur en de inhoud van het csv bestand worden samen in een zip-bestand aangeleverd.

#### 1.2.1 Mappenstructuur

De bijlagen worden in een zip-bestand aangeleverd. In dit zip-bestand zit een mappenstructuur die bepaald wordt door de eerste (bovenste) velden van de GetConnector. In <a href="../../../media/Dossierexport.gcn" download>deze voorbeeld GetConnector</a> zijn dat de velden `Type dossieritem (omschrijving)` en `Medewerkercode`, dus wordt de mappenstructuur `Type dossieritem (omschrijving) > Medewerkercode`. Bijvoorbeeld: `Loonstrook (Profit)\EZW`.

#### 1.2.2 DossieritemId

Zorg ervoor dat de naam van dit veld `DossieritemId` is. De waarde van dit veld moet overeenkomen met het veld `DossieritemId`.

#### 1.2.3 Inhoud van het csv bestand

Het csv bestand bevat altijd het DossieritemId veld, zodat je weet welke bijlagen bij welk dossieritem horen. Daarnaast bevat het een veld met de naam `Bestandsnaam` waarin de naam van het bijlagebestand staat, inclusief de mappenstructuur.
Alle overige velden die je toevoegt aan de GetConnector worden ook opgenomen in het csv bestand. Zorg er dus voor dat je alle relevante informatie toevoegt aan de GetConnector. Dat kan bijvoorbeeld de naam van het dossieritem zijn, de datum waarop het is toegevoegd, etc. Maar ook vrije velden die je zelf hebt aangemaakt kunnen hier toegevoegd worden. Zo maak je je eindresultaat zo compleet mogelijk. In <a href="../../../media/Dossierexport.gcn" download>deze voorbeeld GetConnector</a> zijn dat de velden
- Onderwerp
- Instuurdatum
- Waarde kenmerk 1
- Waarde kenmerk 2
- Inkooprelatienummer
- Administratie (inkoopfactuur)
- Inkoopfactuurnummer
- Factuurbedrag (inkoopfactuur)
- Verkooprelatienummer
- Administratie (verkoopfactuur)
- Verkoopfactuurnummer
- Factuurbedrag (verkoopfactuur)

Je zal zelden precies deze velden nodig hebben, maar hopelijk geeft dit je een idee van de mogelijkheden.

### 1.3 Filteren

Zorg ervoor dat je de GetConnector filtert op de dossieritems waarvan je de bijlagen wilt exporteren. Dus als je alleen de bijlagen van loonstroken wilt exporteren, filter dan op het type dossieritem `-2` (Loonstrook). Dit filter werkt net als in een gewone weergave in Profit, dus je kunt hier ook meerdere waarden filteren of andere filters toepassen.

Controleer in het scherm van de GetConnector of het filter correct is toegepast door op "Voorbeeld" te klikken.


## 2. Maak een AppConnector aan

Maak een AppConnector aan, de naam is niet relevant, voor dit voorbeeld kun je de naam `Dossierbijlagen exporteren` gebruiken.

Gebruik in stap 1 de volgende instellingen:
- **Authenticatietype**: Classic token
- **Automatisch token genereren**: Ja
- **Gebruikergroep**: Maak nieuwe gebruikersgroep op basis van AppConnector-naam
- **Gebruiker**: Maak nieuwe gebruiker aan op basis van AppConnector-naam

### 2.1 GetConnectoren

Deze AppConnector heeft twee GetConnectoren nodig.

#### 2.1.1 Dossierexport

Deze GetConnector is de GetConnector die je in stap 1 hebt gemaakt. Deze GetConnector haalt de dossieritems op waarvan je de bijlagen wilt exporteren. Let op dat de naam precies `Dossierexport` moet zijn, zodat het team Systemintegrators deze kan herkennen.

#### 2.1.2 Profit_Subject_Attachments

Deze GetConnector haalt de bijlagen van de dossieritems op. Dit is een standaard GetConnector die al in de omgeving aanwezig is, namelijk [Profit_Subject_Attachments](../../../OpenApiSpecs/profit/nl/Dossiers%20en%20bijlagen%20en%20workflows#get-/connectors/Profit_Subject_Attachments).

### 2.2 Custom connectoren

#### 2.2.1 SubjectConnector

Voeg de SubjectConnector toe. Deze connector is nodig om de bijlagen van de dossieritems op te kunnen halen. Klik in het tabblad Connectoren op `Nieuw` en selecteer `AppConnectorSubject`.


## 3. Maak een token aan

Maak een token aan, waarbij de volgende rechten zijn toegekend in de autorisatietool:
- Rechten om de GetConnector uit stap 1 uit te voeren via `Algemeen > Beheer > Definitie > Filters > Algemeen - Definitie uitvoeren (o.a. rapport, analyse, document)`. Als je geen Definitiegroep of -categorie hebt ingevuld, dan kun je deze stap overslaan.
- Rechten op de juiste dossieritems via `CRM > Dossier > Dossieritems > Filters`.


## 4. Geef het token aan het team Systemintegrators

Dat kun je het beste doen via een beveiligde manier, bijvoorbeeld via de aanvraag in de klantportal, of via een beveiligde e-mail. Het team Systemintegrators kan dan met dit token de GetConnectoren uitvoeren en de bijlagen exporteren.


## 5. Ontvang het zip-bestand met de bijlagen

Het zip-bestand zal beschikbaar zijn via een beveiligde link die eenmalig te gebruiken is en een beperkte geldigheid heeft. Het team Systemintegrators zal deze link aanbieden via de aanvraag in de klantportal.
Binary file added media/Dossierexport.gcn
Binary file not shown.
Loading