Tabpage "Auto-generate options" |
Chapter: Designing new documenttypes |
also see: Automatically generating documents
In this tabpage you can set options that will be used when you automatically generate a document based on an order. Most of the time you will need only one document per order, but sometimes you may need to generate a document for each product in the order. That's where these options come in:
- (Generate document) Per order: If you check this box, one document is generated per one order, regardless of the productcollection of the order. (Order)Products are retrieved as a collection, so all products will be filled in. This in contrast to the next option, where each product will be individually retrieved for each document.
For example: suppose we have one order, with five products: 2 x Product A, 3 x Product B. Suppose we have our "Marks and numbers" field of our document linked with the order-product field "Product~Name". If you then generate a document based on that order, ONE document will be created and the "Marks and numbers" field will be filled with ALL productnames. The different products will be placed on a new line. So the contents of the "Marks and numbers" field will look like this:
Product A Product B
- (Generate document) Per product in the order: Check this box if you want to generate a separate document for each document in the order. Products are individually retrieved.
For example: suppose we have one order, with five products: 2 x Product A, 3 x Product B. Suppose we have our "Marks and numbers" field of our document linked with the order-product field "Product~Name". If you then generate a document based on that order, FIVE documents will be created and the "Marks and numbers" field of each document will be filled with the five different productnames. So for example the contents of the "Marks and numbers" field of document 1 will look like this:
Product A
- Generate only a document if productfield "XXX" has value "YYY": This option only has effect when generating docments PER PRODUCT. (So if option 2 is checked). Here you can supply a logical condition. If it is met, the document is generated, if the condition is not met, the document is skipped.
Suppose you want to generate a document for each product, but only if the product is a "ADR" product. You then set this option to : 'Only generate document when the productfield ADR has value True'. Now suppose we have one order, with five products: 2 x Product A, 3 x Product B. Product A is a ADR product, while Product B is not. If you now generate a document based on that order, TWO documents will be created, because there are only 2 products in the order which have their "ADR" property set to "True".
|