Difference between revisions of "RequestFormevent"
Jump to navigation
Jump to search
(Created page with "This Codeunit is not ready for use! == What it does == == How to invoke == == Configuration == {| class="wikitable" !Datapoint ! !Type !Notes |- |when |Required |String |Possible values: "after-update" or "before-update". Determines whether the call is executed before or after an item is updated. |- |status |Optional |Array |An array of the StatusID's where the call should be executed. If "after-update", then this is if the item is in one of these status's after the u...") |
|||
Line 2: | Line 2: | ||
== What it does == | == What it does == | ||
This codeunit is capable of performing an HTTP-request with parameters from the updated item and update the item based on the result. | |||
== How to invoke == | == How to invoke == | ||
Add the codeunit <code>dk.tempusserva.codeunit.common.RequestFormevent</code> to the entity and add a configuration named <code>RequestFormevent.Setup</code> with content based on the following configuration. | |||
It is possible to add both a "before-update" and an "after-update" action. | |||
== Configuration == | == Configuration == |
Revision as of 15:53, 16 December 2021
This Codeunit is not ready for use!
What it does
This codeunit is capable of performing an HTTP-request with parameters from the updated item and update the item based on the result.
How to invoke
Add the codeunit dk.tempusserva.codeunit.common.RequestFormevent
to the entity and add a configuration named RequestFormevent.Setup
with content based on the following configuration.
It is possible to add both a "before-update" and an "after-update" action.
Configuration
Datapoint | Type | Notes | |
---|---|---|---|
when | Required | String | Possible values: "after-update" or "before-update".
Determines whether the call is executed before or after an item is updated. |
status | Optional | Array | An array of the StatusID's where the call should be executed.
If "after-update", then this is if the item is in one of these status's after the update, likewise for "before-update". If not given, then the call is executed every time. |
call | Required | The actual configuration of the call. | |
call.url | Required | String | The url that is to be called. This supports input of parameters from the item. |
call.method | Optional | String | The HTTP-method of the call, one of: "POST", "GET", "PUT" or "DELETE". Default: "GET". |
call.type | Optional | String | The datatype of data returned, supported types: "json" or "XML". Default: "json". |
call.headers | Optional | Map | A map of extra headers that should be set |
call.params | Optional | Map | Path parameters that should be set and send. |
call.body | Optional | String | A string that will be set and send. Not available for "GET". |
call.update | Optional | Map | Fields that should be updated based on the data returned. |
Sample
[
{
"when": "before-update",
"status": [69],
"call": {
"url": "https://acme.com/resource/[ID]",
"method": "GET",
"type": "json",
"headers": {
"Authorization": "Bearer XYZ"
},
"params": {
"param": "[DATA]"
},
"body": "",
"update": {
"[INFO]": "[info]"
}
}
}
]
Developer info
- Type: CodeunitFormevent
- Security: Requires session