This event allows you to execute any additional custom code before the Import process into Zetadocs Expenses is run.
Publisher
[IntegrationEvent(false, false)]
procedure OnBeforeImport(var onBeforeImport: Codeunit "Zde OnBefore Import")
begin
end;
Subscriber
To subscribe to this event, you will need to decorate the subscriber method with the correct EventSubscriber attributes:
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Zetadocs Expenses Customize", 'OnBeforeImport', '', true, true)]
This codeunit exposes procedures that allows you to check the type of Import being executed. The following methods are currently available on instances of the OnBeforeImport data type.
Method name |
Description |
---|---|
GetImportType (var ImportType: Enum ZdeImportType) |
Returns the Type of Import being executed. |
SetError (errorMessage: Text) |
Allows setting of a custom error message. |
Init() |
This method is called internally by the publisher, a call to this method will return an error. |
This method returns an enum (ZdeImportType) which allows you to check the type of Import being run, current values are Jobs and Dimensions.
Syntax
importType := onBeforeImportHandler.GetImportType();
Use this method to set custom error messages that will be populated in the Expense Report.
Syntax
onBeforeImportHandler.SetError(errorMessage: Text);
Parameters
errorMessage
Type: Text
The error message to display to the user in Zetadocs Expenses.