AFAS Profit connector

Category: Connectors
Subcategory: Connectors

Overview

AFAS Profit offers connectors to seamlessly integrate your Profit environment with external applications. The AFAS Profit connector enables you to easily connect your Mendix app to your AFAS Profit environment.

Use this module to set up your authentication with one or multiple environments. Then use the standard microflows to integrate the connectors with your own ideas.

For any questions or feedback feel free to contact the developer of this module.

Documentation

Description

AFAS Profit offers connectors to seamlessly integrate your Profit environment with external applications. The AFAS Profit connector enables you to easily connect your Mendix app to your AFAS Profit environment.

Use this module to set up your authentication with one or multiple environments. Then use the standard microflows to integrate the connectors with your own ideas.

Note: We have changed the input parameters and Microflow names to a generic description in version 6.3. This could lead to problems when upgrading old versions of this connector. The easiest way to migrate is to download this module separately, change the descriptions in your current applications to the ones of the new module. And then import the module to replace the microflows.

Typical usage scenario

  • Retrieve data from the AFAS database through its web services
  • Update data in the AFAS database through its web services
  • View failed integrations and troubleshoot these.
  • Change failed integration messages and retry.
  • Connect with multiple AFAS environments

Features and limitations

Features

  • GetConnector: Retrieve data from AFAS
  • UpdateConnector: Update or delete DATA in AFAS
  • Logging of all AFAS integration activities
  • Retry failed integrations.

Limitations

 

Dependencies

  • CommunityCommons
  • Encryption module

Installation

This module is dependent on Community commons and Encryption. Make sure to download these modules before following the installation guide.

  •  Install the CommunityCommons module from the marketplace to your application
  •  Install the Encryption module from the marketplace to your application
  •  Install this module into your Mendix application (9.6.2 and up) 

Do not modify this module, instead:

  1. Add the security role AfasConnector.Administrator to an existing administrator role.
  2. Add the SNIP_AfasConnector snippet to a page accessible to you. Make sure this page is within one of your own modules. Optionally you can directly use the AfasConnector_Overview page.
  3. Create a new module, e.g. 'AFAS_Interface'.
  4. Add new pages, copy or reuse snippets and microflows from the _Use_Me folder in this module into the 'AFAS_Interface' module. For example, you can use the microflows within the _Use_me folder directly within your microflows.
  5. Make sure the default constant 'IntegrationEnabled' is set to true, else the integration won't work.
  6. In order to secure your AFAS token, it is required to enter an encryption key in the constant 'EncryptionKey' which can be found in the Encryption module.

Configuration

To set up the AFAS Profit connector, you'll need to have access to a token of an authenticated user.

  1. Create an app connector in AFAS and generate a token for this specific user.
  2. Open the AFAS Profit connector page in runtime that has the 'SNIP_AfasConnector'  snippet.
  3. Click “Create new environment” or edit one of the three default environments
  4. Give the environment a friendly name in the “Name” field
  5. Select the type of AFAS environment (production, accept, test)
  6. Enter the AFAS Online member number, consisting of five digits
  7. Enter the authorization token in XML format
  8. Activate the environment using the active or save button.
  9. If everything was done correctly the environment will be active. The environment will automatically be tested and validated, after which the available GetConnectors and UpdateConnectors will be retrieved and shown as well. You can now use the standard microflows to create the integrations you desire!

In case you want to use multiple environments you can create a new environment with a different name. The module currently validates that only 1 environment with a specific name can be active. 

Using the module

Using the microflows
--------------------
You can use the microflows explained below inside your own microflows. These microflows will return an HttpResponse. You can use the Rule in the _Use_Me folder to check if the update was successful to improve your error handling.


GET
Use the PRS_Standard_Get inside your own microflows, and add the following parameters:
 - Connectorid (The name or id of the GetConnector)
 - QueryString (A string containing all the filters and sorting queries that you desire.) In case this is not necessary add ''
 - Skip (The skip value that should be used)
 - Take (The take value that should be used)


POST
Use the PRS_Standard_Post inside your own microflows, and add the following parameters:
 - Connectorid (The name or id of the UpdateConnector)
 - RequestBody (The JSON input that the connector should use for the request body)


PUT
Use the PRS_Standard_Delete inside your own microflows, and add the following parameters:
 - Connectorid (The name or id of the UpdateConnector)
 - QueryString (A string value that the Connector will use as the query)


Delete
Use the PRS_Standard_Put inside your own microflows, and add the following parameters:
 - Connectorid (The name or id of the GetConnector)
 - RequestBody (The JSON input that the connector should use for the request body)

Additional information

- The Constant 'IntegrationEnabled' is set to false by default. This will ensure that when restoring a database to a local or accept environment the runtime tokens will not immediately activate. With this you can set up your new environment first and when ready enable this constant.
 
 - This module can be used for multiple AFAS environments, you can use the multiple environment microflows instead of the standard ones. Here you have to enhance your microflows by retrieving the right environment using the name of the environment as input. This is the name you entered yourself on the configuration page.

 - Inside the logging folder within Private there is a JSON and import mapping for the content of the AFAS HttpResponse. You can use this to show more user-friendly messages in the case of errors.

 - There is no clear best practice in setting up your integrations. Each application will ask for its own specific design in behavior and handling of objects. This integration connector serves to call integrations with AFAS in a standardized way including logging. This should speed up the development process, enable better debugging and allow for general updates of the integration module when AFAS releases new patches. We plan to add our own best practices to this module. In case you have any questions or are looking for advice regarding your AFAS integrations. Feel free to contact the developer of this module.

Bugs

  • Unknown

Roadmap

  • Support for ReportConnector
  • Support for VersionConnector
  • Support for FileConnector
  • Support for ImageConnector
  • Support for SubjectConnector

Releases

Version: 6.3.1
Framework Version: 9.6.9
Release Notes: - Removed encoding of QueryString, this had some unexpected side affects on some calls to AFAS
Version: 6.3.0
Framework Version: 9.6.9
Release Notes: - Added extra logic to handle QueryString inputs that do not have a ' ? ' at the start of the string. - Added URL encoding for Get and Delete queries - Improved the documentation and readme files - Improved folder structure - Implemented a generic rule to check if a connector was successful - Improved the Cleanup microflows of logging with batch deletes. - Changed the name of the connector to AFAS Profit Connector instead of AFAS Profit ERP Connector - Improved UI improvements - Fixed a bug in the logging retry functionality where it would not allow a new request for logging objects with an error.
Version: 6.2.1
Framework Version: 9.6.9
Release Notes: - Changed the Expose as microflow action settings
Version: 6.2.0
Framework Version: 9.6.9
Release Notes: New Features - Implemented the possibility to add multiple environments in case one application has to update various AFAS environments. This can be done by creating different environments with different names. - Improved the microflow structure to enable easier re-usability and customizable microflows without touching the main logic of the Get, Post, Put and Delete microflows. Improvements - Set environments as default tab - Changed lay-outs to top bar - Integration enabled boolean is now true by default.
Version: 6.1.1
Framework Version: 9.6.9
Release Notes: - Added created date in logging interface