AFAS Profit connector
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:
- Add the security role AfasConnector.Administrator to an existing administrator role.
- 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.
- Create a new module, e.g. 'AFAS_Interface'.
- 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.
- Make sure the default constant 'IntegrationEnabled' is set to true, else the integration won't work.
- 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.
- Create an app connector in AFAS and generate a token for this specific user.
- Open the AFAS Profit connector page in runtime that has the 'SNIP_AfasConnector' snippet.
- Click “Create new environment” or edit one of the three default environments
- Give the environment a friendly name in the “Name” field
- Select the type of AFAS environment (production, accept, test)
- Enter the AFAS Online member number, consisting of five digits
- Enter the authorization token in XML format
- Activate the environment using the active or save button.
- 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