Export - FAQ

This article is based on frequently asked questions about export issues. It attempts to provide clear explanations, and to offer workable solutions.

Why is my assortment variable not visible in data sources of export?

The problem

You want to use a variable to specify the item assortment of an item data provider, but the variable is not in the list of available item assortments.

You've defined the variable correctly...

images/download/attachments/479246972/DefineAssortmentVariable.png

... but it is not shown in the item assortment list

images/download/attachments/479246972/MissingAssortmentVariable.png

The solution

An item assortment variable is independent of an item catalog. That's why there are no item assortment variables available if you've specified the catalog for a data source.

If you choose "<dynamic>" as catalog parameter value you get the item assortment variable displayed in the list.

images/download/attachments/479246972/SolvedProblem.png

How can I differentiate my output file?

The problem

Usually the output file of an export will get the same name as the export template. But you need to differentiate the output file between each export.

You've defined a delta export with some variables which you would like to have in your output file.

images/download/attachments/479246972/image2017-4-10_16_30_6.png

The solution

You can define the generated file pattern in each export format template. Therefore you need to go to the "File management" tab where you can see the default output file and extended options. To be able to use variables in your output file you need to enable the "Extended options" and create a new file. Next, you need to click on the button in order to define a pattern:

images/download/attachments/479246972/image2017-4-10_16_39_21.png

In this popup menu you use your variables and function in order to define your output file name pattern.

images/download/attachments/479246972/image2017-4-10_17_20_57.png

After defining the pattern you need to add your created file as "Export file" in each module and submodule of your export format template.

Is it possible to disable or remove the 'Generate Preview' function in Desktop client?

images/download/attachments/479246972/ContextMenu.PNG

Yes, it is.

With the "Export Purpose" attribute of repository root entities you can configure the behavior of the export context menu, see Customizing - Server and Platform - Domain Model (Repository).

If you want to disable the "Generate preview" functionality for items, you have to adjust the corresponding export purpose value of the "Article" root entity in repository: change it from "15" (export (1) + preview (2) + supplier portal (4) + immediate export (8)) to 13 (export (1) + supplier portal (4) + immediate export (8))

images/download/attachments/479246972/Repository.PNG

How can I implement conditional output of file attachments?

The problem

You have a simple condition in top module (item list level) so that only few items pass through. In a sub-module you want to export all file attachments of the "good" items using the ExportMime export function for exporting images. The file attachments of all items that don't meet the condition are expected to not be exported.

But the resulting image zip export file contains images of all items.

images/download/attachments/479246972/image2018-12-27_12-10-49.png

Explanation

Similar to function calls (see Export functions) it is not possible to have conditional sub module calls. Each sub module call is executed during an export. The only thing you can do is to hide the output of a sub module into the corresponding export file.

The solution

You can check the condition in the calling top module and save the result to a variable using the ValueSet export function. The sub-module can use that variable value by ValueGet and prepare the corresponding function call.

In the example, an empty document identifier is passed to the ExportMime function in case the condition is not fulfilled.

images/download/attachments/479246972/image2018-12-27_12-16-2.png

How can I make the export fail if the command executed in post-step reports errors?

The problem

You have an export post-step that executes a command file. That command file handles errors. You want your export to be cancelled if an error occurred during the command execution.

With default values of the "Execute command file" export post step and a common command file the export will be finished successfully even if the command could not be executed successfully.

The solution

First you have to redirect the error message to the stderr in your command file, e.g.

@echo off
:: Writes a message to stdout
echo Hi, this is the good message
 
:: Writes a message to stderr
echo Hi, this is the bad message 1>&2

Second, you have to configure the export post-step:

  • Set "Log output" to "only errors" or "all" to get messages of the command written into the export log

  • Set "Cancel export in case of error" to "Yes" to get the export job cancelled if an error is reported by the command

images/download/attachments/479246972/ConfigurePostStep.PNG

Each error or each message written by your command will be added to the export protocol:

images/download/attachments/479246972/ExportLogWithError.PNG

Can I run multiple exports of the same assortment at the same time?

Yes, if...

... the exports don't update the assortment.

No, if...

... the exports update the assortment.

Explanation

If an assortment is updated by multiple export jobs at the same time the export result is unpredictable: when assortment data is read while being modified by another instance, an intermediate state could be read.

But if I need to update the assortment?

Either..

.. run the first export which updates the assortment and schedule the other exports which don't update the assortment to run some minutes later

or...

... use different assortments for the exports. But be careful, maybe this approach could cause performance issues if the assortments are complex or big.