D365 F&SCM supports custom services. With a custom service, you can call application logic in D365 F&SCM from outside D365 F&SCM.
For Connectivity Studio, a two custom service are available for messages: 'BisMessageStartFromHttp' and 'runMessage' (both in service group 'BisMessageHttpAction').
Custom service: 'BisMessageStartFromHttp'
The 'BisMessageStartFromHttp' custom service has these service operations:
Operation | Description |
|---|---|
executeMessage | Runs a message to import data into D365 F&SCM. |
executeMessageGet | Runs a message to export data from D365 F&SCM. |
For these service operations, the arguments are:
Argument | Description |
|---|---|
ProjectId | The identification of the project in Connectivity Studio. |
Message Id | The identification of the message in Connectivity Studio. |
Content | The body content of the data to be imported.
|
To call the custom service from outside D365 F&SCM, use a URL like:
https://Instancename.cloudax.dynamics.com/api/services/BisMessageStartFromHttp/BisMessageHttpAction/executeMessage
('Instancename' = Your D365 F&SCM instance identification)
Make sure to call the custom service operation with the arguments. So, the call must include the value for each of the arguments.
Custom service: 'runMessage'
The 'runMessage' custom service has these service operations:
Operation | Description | Contract |
|---|---|---|
ExportFromD365FO | Runs a message for specific data. For example, for a specific record or field value. | BisServiceMessageArgumentsD365Fo |
ImportFromFile | Runs a message to import a specific file. | BisServiceMessageArgumentsFile |
ImportFromStaging | Runs a message to import a specific staging journal into D365 F&SCM. | BisServiceMessageArgumentsStaging |
ImportFromODBC | Runs a message to import specific ODBC data. | BisServiceMessageArgumentsODBC |
For these service operations, the arguments are defined in a contract, as shown in the previous table. The arguments are:
Argument | Description |
|---|---|
ProjectId | The identification of the project in Connectivity Studio. |
Message Id | The identification of the message in Connectivity Studio. |
Company | The applicable company ID in the D365 F&SCM environment. |
RunAsyncronize | You can run a message asynchronous. As a result, the message runs directly in a separate background process. So, you can continue working on the client when the message runs.
|
Arguments | On a source document, ranges can be used to restrict the data to be processed. A range of type ‘Parameter’ can be used as additional argument to call a custom service operation. To do so, in the JSON to call the custom service define the range as argument with the applicable values.
|
SourceFileName | The name of the source file, including the path.
|
SourceContent | The content of the file if the file name is not used.
|
StagingJournalId | The ID of the staging journal to be imported into D365 F&SCM.
|
To call the custom service from outside D365 F&SCM, use a URL like:
https://Instancename.cloudax.dynamics.com/api/services/BisMessageStartFromHttp/runMessage/ExportFromD365FO
('Instancename' = Your D365 F&SCM instance identification)
Make sure to call the custom service operation with the arguments. So, the call must include the value for each of the arguments.
Examples of JSON to call custom service: 'runMessage'
The JSON to call the 'ExportFromD365FO' custom service operation can be:
{
"ProjectId": "your project ID",
"MessageId": "your message ID",
"Company": "USMF",
"RunAsyncronize": false,
"Arguments": [
{
"FieldName": "Custaccount",
"FieldValue": "us-027"
}
]
}The JSON to call the 'ImportFromFile' custom service operation can be:
{
"ProjectId": "your project ID",
"MessageId": "your message ID",
"Company": "USMF",
"RunAsyncronize": false,
"SourceFileName": "path+file name",
"SourceContent": "file content if SourceFileName is not used"
}The JSON to call the 'ImportFromStaging' custom service operation can be:
{
"ProjectId": "your project ID",
"MessageId": "your message ID",
"Company": "USMF",
"RunAsyncronize": false,"
"StagingJournalId": "your staging journal ID"
}For more information on custom services, refer to: