Codeunit "File Scenario"
Provides functionality to work with file scenarios.
Methods
GetDefaultFileAccount
Gets the default file account.
procedure GetDefaultFileAccount(var TempFileAccount: Record "File Account" temporary): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| TempFileAccount | Table System.ExternalFileStorage."File Account" |
Out parameter holding information about the default file account. |
Returns
| Type | Description |
|---|---|
| Boolean |
True if an account for the default scenario was found; otherwise - false. |
GetFileAccount
Gets the file account used by the given file scenario. If the no account is defined for the provided scenario, the default account (if defined) will be returned.
procedure GetFileAccount(Scenario: Enum "File Scenario", var TempFileAccount: Record "File Account" temporary): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| Scenario | Enum System.ExternalFileStorage."File Scenario" |
The scenario to look for. |
| TempFileAccount | Table System.ExternalFileStorage."File Account" |
Out parameter holding information about the file account. |
Returns
| Type | Description |
|---|---|
| Boolean |
True if an account for the specified scenario was found; otherwise - false. |
SetDefaultFileAccount
Sets a default file account.
procedure SetDefaultFileAccount(TempFileAccount: Record "File Account" temporary)
Parameters
| Name | Type | Description |
|---|---|---|
| TempFileAccount | Table System.ExternalFileStorage."File Account" |
The file account to use. |
SetFileAccount
Sets a file account to be used by the given file scenario.
procedure SetFileAccount(Scenario: Enum "File Scenario", TempFileAccount: Record "File Account" temporary)
Parameters
| Name | Type | Description |
|---|---|---|
| Scenario | Enum System.ExternalFileStorage."File Scenario" |
The scenario for which to set a file account. |
| TempFileAccount | Table System.ExternalFileStorage."File Account" |
The file account to use. |
UnassignScenario
Unassign an file scenario. The scenario will then use the default file account.
procedure UnassignScenario(Scenario: Enum "File Scenario")
Parameters
| Name | Type | Description |
|---|---|---|
| Scenario | Enum System.ExternalFileStorage."File Scenario" |
The scenario to unassign. |
Events
OnBeforeInsertAvailableFileScenario
Event for changing whether an file scenario should be added to the list of assignable scenarios. If the scenario has already been assigned or is the default scenario, this event won't be published.
[IntegrationEvent(False,False,True)]
internal procedure OnBeforeInsertAvailableFileScenario(Scenario: Enum "File Scenario", var IsAvailable: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| Scenario | Enum System.ExternalFileStorage."File Scenario" |
The scenario that is going to be added to the list of assignable scenarios. |
| IsAvailable | Boolean |
The return for whether this scenario should be listed in the assignable scenarios list. |