LN 10.5 Ttdomug En-Us
LN 10.5 Ttdomug En-Us
LN 10.5 Ttdomug En-Us
Important Notices
The material contained in this publication (including any supplementary information) constitutes and
contains confidential and proprietary information of Infor.
By gaining access to the attached, you acknowledge and agree that the material (including any
modification, translation or adaptation of the material) and all copyright, trade secrets and all other
right, title and interest therein, are the sole property of Infor and that you shall not gain right, title or
interest in the material (including any modification, translation or adaptation of the material) by virtue
of your review thereof other than the non-exclusive right to use the material solely in connection with
and the furtherance of your license and use of software made available to your company from Infor
pursuant to a separate agreement, the terms of which separate agreement shall govern your use of
this material and all supplemental related materials ("Purpose").
In addition, by accessing the enclosed material, you acknowledge and agree that you are required to
maintain such material in strict confidence and that your use of such material is limited to the Purpose
described above. Although Infor has taken due care to ensure that the material included in this publication
is accurate and complete, Infor cannot warrant that the information contained in this publication is
complete, does not contain typographical or other errors, or will meet your specific requirements. As
such, Infor does not assume and hereby disclaims all liability, consequential or otherwise, for any loss
or damage to any person or entity which is caused by or relates to errors or omissions in this publication
(including any supplementary information), whether such errors or omissions result from negligence,
accident or any other cause.
Without limitation, U.S. export control laws and other applicable export and import laws govern your
use of this material and you will neither export or re-export, directly or indirectly, this material nor any
related materials or supplemental information in violation of such laws, or use such materials for any
purpose prohibited by such laws.
Trademark Acknowledgements
The word and design marks set forth herein are trademarks and/or registered trademarks of Infor and/or
related affiliates and subsidiaries. All rights reserved. All other company, product, trade or service
names referenced may be registered trademarks or trademarks of their respective owners.
Publication information
Infor LN Release: 10.5.1
Contents
Chapter 1: Introduction..................................................................................................9
System Requirements...............................................................................................................................9
Chapter 2: Overview.....................................................................................................11
Terms and definitions..............................................................................................................................12
Document authorization...........................................................................................................................14
Receiver independent destinations.........................................................................................................14
Rendering and distributing documents....................................................................................................14
Viewing documents..................................................................................................................................15
Previewing documents.........................................................................................................................15
Easy overlaying....................................................................................................................................15
Instant distribution....................................................................................................................................15
Restarting failed documents....................................................................................................................16
Repeating and canceling distribution.......................................................................................................16
Cleanup document store..........................................................................................................................16
Using conditions......................................................................................................................................30
Using different rendering options for one report..................................................................................30
Using other overlay for different companies........................................................................................31
Using other overlay for draft invoice....................................................................................................32
Using other mail from address for different purchase office................................................................33
Using other printer for different purchase office...................................................................................34
Using images in the e-mail body text.......................................................................................................35
Additional information...........................................................................................................................36
Using existing documents........................................................................................................................36
Additional information...........................................................................................................................38
Addendum documents.............................................................................................................................39
Configuring addendum documents......................................................................................................39
Custom destination types and customer receiver types..........................................................................40
Using custom destinations...................................................................................................................40
Using customer receiver types.............................................................................................................46
Using custom e-mail................................................................................................................................49
Using custom fax.....................................................................................................................................52
Defining document providers...................................................................................................................54
Setting up a Document Provider Rule.....................................................................................................56
Using document providers.......................................................................................................................56
Chapter 6: Troubleshooting.........................................................................................67
Logging....................................................................................................................................................67
Debugging...............................................................................................................................................67
Custom implementations......................................................................................................................68
Expressions..........................................................................................................................................68
Appendix C: Faxing......................................................................................................77
Glossary.........................................................................................................................81
This guide covers the basic features of Infor LN Document Output Management (DOM) and how this
can improve the way your organization delivers documents. You will be guided through the process of
sending your first document. The more advanced topics, where you can send documents to your own
document management system are also explained.
Intended audience
This guide is intended to assist users and system administrators of Infor LN who want to use Document
Output Management to send the report output to their preferred destination.
Related documents
You can find the documents in the product documentation section of the Infor Xtreme Support portal,
as described in "Contacting Infor".
Contacting Infor
If you have questions about Infor products, go to the Infor Xtreme Support portal.
If we update this document after the product release, we will post the new version on this website. We
recommend that you check this website periodically for updated documentation.
If you have comments about Infor documentation, contact [email protected].
System Requirements
For printing you must connect to a printer which supports direct printing of PDF files. The printer must
be able to handle a byte stream with PDF data which will be sent from LN.
Document Output Management is an easy and very flexible solution to send the documents, where
your customers define how they want to receive their documents.
This diagram shows the Document Output Management architecture:
Component Description
LN Print Session The LN Print Session represents any LN session which col-
lects data from an LN database and produces a report output
(raw report data). Document Output Management is designed
in such a way, that these LN sessions do not need any mod-
ification to support Document Output Management.
Document Preparation Engine The LN Document Preparation Engine generates a batch of
documents with routing information. These documents are
stored as raw document in the Document Store.
Component Description
Document Store The Document Store holds all the documents which were
generated by the LN Document Preparation Engine. From
the Document Store these documents can be viewed including
attachments and overlays. If a document is rendered by the
LN Document Rendering Engine, the final document is stored
in the Document Store, where it can be distributed by the LN
Distribution Engine. It is also possible to repeat a distribution
for an already distributed document from the Document Store.
Document Rendering Engine The LN Document Rendering Engine takes the raw document
from the Document Store and processes this to a document
in PDF or Excel format. The reporting solutions which can be
used by the LN Document Rendering Engine are: Infor Re-
porting, Microsoft SSRS Reporting and Infor LN's own PDF
/ Excel creation.
Document Distribution Engine The LN Document Distribution Engine retrieves the document
from the Document Store. Applies overlays to it, adds addi-
tional attachments, and distributes it to the preferred destina-
tion. This destination can be: e-mail, printer, Infor Document
Management, or a customer defined destination, or a combi-
nation of those destinations.
Document
A document is a file produced by an LN print session or a file provided by an external document
provider. Each document is stored in the Document Store from where it can be used for further
processing
Batch
A batch is a group of documents produced by one print job.
Document type
A document type describes how a document of a specific category, such as Sales Order
Acknowledgement or Invoice, must look when it is distributed to the receiver. A document type contains
the email subject and email body text, the overlay page, extra attachments that must be added to the
document, and so on.
You can use variables in the parts of the document type. Those variables are replaced by real report
values at the moment the document is distributed.
Report rule
A report rule is used to define the report-specific settings, such as how to split up the report in several
documents and which report server or report design should be used to render the report. Also the
mapping between the report fields and the document type variable is defined in the report rule. You
can define multiple Report Rules for one report. Based on the outcome of an expression, one of the
report rules is selected. If no expression is valid, the default report rule for that specific report is selected.
A report rule links a report to a specific document type.
Receiver type
A receiver is a person or organization who receives the document. Several types are supported:
• Business Partner
• Contact
• Employee
• User
• Custom
Destination type
A destination is the place where to send the documents to. Several types are supported:
• E-mail
• Print
• Custom
• Fax
Document provider
A document provider provides, documents to be distributed with Document Output Management. The
documents are expected to be in a rendered format.
Document provider fields
The document provider specifies the document provider fields with data at the time a document is
provided to Document Output Management.
Document provider contexts
A document provider can define zero or more contexts. A context can be used in Document Output
Management to differentiate between Document Type Parts to be used when distributing a document.
The document provider specifies the context at the time a document is provided to Document Output
Management.
Document provider rules
Document provider rules can be defined for a document provider.
The mapping between the provider fields and the document type variable is defined in the document
provider rule. You can define multiple Document Provider Rules for one document provider. Based
on the outcome of an expression, one of the rules is selected. If no expression is valid, the default
document provider rule for that specific document provider is selected.
A document provider rule links a document provider to a specific document type.
Document authorization
Users are only allowed to render, distribute, or view documents from the Document Store if they have
print authorization for the LN session that produces the document.
Users are not allowed to perform any action on a document if they do not have company authorization
for the company in which the document was created.
If a user is not authorized to perform an action, the action is disabled or a message is displayed.
Viewing documents
Once available in the Document Store, you can view the documents. Select a document and choose
the action View Document. This will view the document including overlays. Besides this, there are two
options to preview documents.
Previewing documents
Usually, documents are rendered and distributed when choosing the Document Output Management
device. Afterwards, you can view the distributed document. To preview the document, before it is
distributed to the receiver, set the Use During Preview field to Yes in the Document Type Details
session.
When printing the document to the Preview device, a 'Preview' batch will be created. When the preview
looks fine, the preview batch can be converted to a real batch to be distributed in the normal way.
Select the action Convert Preview Batch to Distributable Batch in the Batches (ttrpi3500m000)
session.
Easy overlaying
You can preview a document with overlays without setting up the distribution for the document type.
This is called easy overlaying and enables you to preview your document with your house style in an
easy way.
You must create a document type that has the Split and Distribute Documents field set to No.
When you print the document to the Preview device, the document is stored in the Document Store,
but is not distributed to any destination. Once the document is available in the Document Store, you
can preview it including overlays and, if desired, send it to a destination using the Instant Distribution
functionality.
Instant distribution
You can send a document directly to a customer or printer without the intervention of the Rendering
and Distribution Engine. This is called instant distribution. To do this, select a document and select the
'View Document' action. The Document Viewer starts. Right-click the document and select one of these
actions:
• Send to other Printer Destination. Specify a device and click Send.
• Send to other Email Destination. Specify a valid e-mail address, modify the e-mail body or select
a predefined e-mail body, fill the document variables, and click Send.
• Send to other FAX Destination. Specify a valid Fax number and click Send.
• Send to other Custom Destination. Specify Type and address and click Send.
To get you up and running with Document Output Management, we will cover some of the basic features
and guide you through sending your first DOM document. You will learn more about advanced features
using the online Help, or you can continue with "Advanced Options" on page 27.
As an example the Request for Quotation report will be send to an e-mail recipient.
Setting up e-mail
Before you can use e-mail facilities from LN, you must complete these steps:
1 Start the Service Providers (ttcmf0110m000) session.
2 Check whether the "SMTP" provider exists.
3 If not, create a service provider with these properties:
• Provider: SMTP
• Description: SMTP
• 4GL Connector: ttcmfsmtp
9 Specify a valid e-mail address (Email Type: SMTP) for the user(s) in the User Data (ttaad2500m000)
session.
10 Select eMessage Connection in the Parameters (ttrpi2100s000) session.
Setting up fax
Before you can use fax facilities from Infor LN, complete these steps:
1 Start the Parameters (ttrpi2100s000) session.
2 Select one of these Fax Solution options:
Option Description
Email Faxing Faxes are sent as 'normal' e-mail as defined earlier. Specify a correct
e-mail address used for faxing. This address can contain variable values,
depending on the used fax solution provider. See "Faxing" on page 77.
Custom Library You can use an own implementation of a fax solution.
Note: This distributes the documents to the current user running the Request for Quotation report.
This is not the Receiver Type you will use in the final setup. It is used to see the first results of your
document type setup.
• Keyword 1, Description: RFQ
• Keyword 1, Zoom Session: tdpur1501m000
• Keyword 1, Zoom Return Field: tdpur105.qono
• Keyword 2, Description: BP
• Keyword 2, Zoom Session: tccom4500m000
• Keyword 2, Zoom Return Field: tccom100.bpid
Save this Document Type record.
3 Go to the Parts tab to create a new Part.
This Part will be used as e-mail subject. Specify these properties:
• Description: Subject
• Destination Type: Email
• Part Type: Email Subject
• Simple Content: Request for Quotation #rfq#
Variables are placed between hashes (#) and will be replaced at runtime.
Save this record.
4 In the Parts tab, create a new Part.
This Part will be used to upload the body text file. Specify these properties:
• Description: Body
• Destination Type: Email
• Part Type: Email Body
Save this record.
5 On your local system create a text file with this content:
Dear partner,
#purchaseoffice#
6 Select the action Upload File from the just created Document Type Part. Upload and add this text
file to the Document Type Part.
Note:
• The Variables tab contains the three variables, which were used in the text file. These variables
will be used later, where they will be mapped to report input fields.
• You can create an html file instead of a text file. This html file can contain the same variables
and some pictures and logos.
Expression Specification
bp tdpur105.otbp
keyword1 tdpur105.qono
keyword2 tdpur105.otbp
keyword3 ""
keyword4 ""
purchaseoffice tdpur012.dsca
receiverfield logname$
rfq tdpur105.qono
splitfield tdpur105.qono & tdpur105.otbp
font.scaling "9"
show.total.number.of.pages "No"
Ensure that your current user's e-mail address has been filled in the address book.
5 Optionally, double-click the just created record. The User Document Type Destinations (ttrpi2552s000)
session is displayed.
In this session, you can add extra e-mail addresses to send (blind) copies of the document.
6 Click Continue. This will produce a document in PDF format, and distribute this to the e-mail recipient.
Usually this Document Rendering and Distribution session is running in an LN Job. It will continuously
search for new documents in the Document Store, which are ready to be rendered and distributed.
You can use multiple additional servers to spread the work over multiple bshells.
7 Start the Batches (ttrpi3500m000) session to view the status of the just created batch and its
document.
Using overlays
Overlays are used to place additional information on a document. Overlays are PDF files, which are
merged with the document before the document is sent. For example, to ensure that the word COPY
is shown on the document if the document is sent to a local printer. If the document is sent to a customer,
it must contain your corporate identity.
You can define multiple overlays for one document type. Based on the outcome of an expression, the
overlay is selected. All overlays with a valid expression are merged to the document.
This screenshot shows an example:
Adding overlays
To add an overlay page to your document type:
1 Create a one page PDF file containing your company house style, and store it on your local PC.
2 Start the Document Types (ttrpi2510m000) session, and select and open the RFQ document type.
3 On the Parts tab, create a new Part with these properties:
• Description: Housestyle
• Destination Type: All
• Part Type: Overlay
Save this record
4 Choose the Upload File action.
5 Select the just created PDF file with your corporate house style and click Open.
6 Print and send the document and view the result.
Using attachments
You can add attachments to the document type. These attachments can be merged with the document
or sent as separate file.
For example, you can add a price list to your document, which will be merged with the document. An
extra terms and conditions document can be added to the document as separate file.
You can define multiple attachments for one document type. Based on the outcome of an expression,
the attachment will be selected. All attachments with a valid expression will be merged to the document
or added as separate file.
To add an attachment to your document type:
1 Create a PDF file containing terms and conditions, and store it on your local PC.
2 Start the Document Types (ttrpi2510m000) session, and select and open the RFQ document type.
3 On the Parts tab, create a new Part with these properties:
• Description: Terms and Conditions
• Destination Type: Email
• Part Type: File to Attach
• Relative Position: After
• Order: 0
• Separate File: No
Save this record
4 Choose the Upload File action.
5 Select the just created PDF file with the terms and conditions and click Open.
6 Print and send the document and view the result.
To test if you are printing to the correct printer, add the destination type Print in the User Document
Type Settings (ttrpi2551m100) session.
By now, you have learned some of the basic features of Document Output Management and you have
created and sent your first Document Output Management document.
Document Output Management also contains advanced features and several options to enhance the
reports and documents. How to use different reports or documents by using condition expressions will
be explained.
Additional information
To get the language in which the document is printed, you can use the dom.document.language
variable in expressions linked to the Document Type.
1 Start the Report Rules (ttrpi2520m000) session. Select the Sales Contract Acknowledgement report
(tdsls340501000) and open its details.
2 On the Design Codes tab, create a new design code called dd250 with this expression:
table ttccom110
select tccom110.cdf_gov
from tccom110
where tccom110.ofbp = :tdsls300.ofbp
as set with 1 rows
selectdo
if tccom110.cdf_gov = tccdf______chk.yes then
return(true)
endif
endselect
return(false)
Additional information
Different report designs can be used, based on the outcome of a condition.
In the expression linked to the report design you can use report fields and customer defined fields.
You can also use configurable designs for different countries or languages if not everything can be
handled by labels.
Using conditions
You can use different rendering options for one report and other overlay for different companies.
Note: On the Variables tab, nine variables are created. These variables must get a valid expression.
Additional information
Different report rules can be used, based on the outcome of a condition.
Note: In the expression the predefined variable dom.batch.session.pid was used. See appendix
B for the complete list of predefined variables.
In the expression you can also use customer defined fields or form fields of the print session.
1 Start the Document Types (ttrpi2510m000) session. Select the RFQ document type and open its
details.
2 On the Parts tab, open the already existing overlay part, which contains the house style of your
company.
3 Add this code to the Condition Expression field:
Additional information
For each company you can use the house style of that company, without changing the report.
• Create a document type and report rule for the Invoice report, or use an existing document type.
• You will create an extra overlay pdf file, which will be added to the Invoice report for draft invoices.
Other invoice reports will not get this overlay. Based on a condition, the draft overlay is selected
and merged with the document.
Complete these steps:
1 Start the Document Types (ttrpi2510m000) session. Select the Invoice document type and open its
details.
2 On the Parts tab, add a new record for another overlay part with these properties:
• Description: Overlay Draft
• Destination Type: All
• Part Type: Overlay
• Overlay Type: All Pages
Additional information
You will notice that different mail-from addresses can be used, based on the outcome of a condition.
• You will create different print devices, and add them to the document type. Based on the name of
the purchase office one of the Print Devices is used to create the hard copy of the Request for
Quotation report.
Complete these steps:
1 Start the Document Types (ttrpi2510m000) session. Select the RFQ document type and open its
details.
2 On the Print Devices tab, add a default Device and select one of the available Devices.
This default Print Device is used if none of the other Print Devices has a valid expression.
3 Add another Print Device for each of your purchase offices. Add this code to the Condition
Expression field:
Additional information
You will notice that different printers can be used for different office locations.
Note: You can also use different print devices where each printer has its own preprinted stationary.
• You will include an image in the e-mail body text, which is located on a local drive.
Complete these steps:
1 Start the Document Types (ttrpi2510m000) session.
2 Select the RFQ document type and open its details.
3 Add a new document type part to the document type and specify this information:
• Destination Type: Email
• Part Type: File to Attach
• Simple Content: image1
• Separate File: Yes
4 Click Upload to upload the local image and link this to the just created document type part.
5 Specify the Simple Content field, for example: image1.
6 Specify the src attribute of the img tag, which is used as e-mail body:
src=cid:image1
Note that the same name is used as simple content in the document type part, prefixed with cid:
7 Upload the html file again in the other document type part which is used as Email Body.
8 Click Validate to validate the document type.
9 Run the Request for Quotations session.
10 Print a Request for Quotation to the Document Output Management device and view the results.
Additional information
You will notice that the image is not attached to the e-mail as separate document, but is included in
the email body. The content-id (cid) of the image is used as reference in the html file.
long node
node=dom.existing.document.add("INVOICE",str$(dom.document.company),
"keyword3","20001963")
dom.add.part(node,7)
table ttfacr200
long node
Additional information
You will notice that an extra document is attached to the e-mail, which contains the original invoice. In
the expression of this new part, the existing document is read from the Document Store using the
keywords. It is therefore very important to fill the keywords with proper values.
In the expression you are using the function dom.existing.document.add() to retrieve the existing
invoice document from the Document Store and add this to your e-mail message. This function has
this syntax:
Syntax:
function long dom.existing.document.add(
string i.doctype,
string i.doc.company,
[string i.keyword1,
string i.value1,
string i.keyword2,
string i.value2,
string i.keyword3,
string i.value3,
string i.keyword4,
string i.value4])
Description:
This function retrieves an existing document from the Document Store,
including
overlays and adds this to the document currently processed.
Arguments:
string i.doctype
The document type of the existing document.
string i.doc.company
The company of the existing document.
string i.keyword1, i.value1, i.keyword2, i.value2, i.keyword3, i.
value3, i.keyword4, i.value4
The (optional) string pairs for the keywords and
their values,
to search the document.
Return value:
You are also using function dom.add.part() to add an overlay to the document. This function has
this syntax:
Syntax:
function dom.add.part(
long i.document,
long i.sequence)
Description:
This function adds an extra overlay to the existing document.
Arguments:
long i.document
The xml node which contains the existing document.
long i.sequence
The sequence of the overlay to set
Addendum documents
Document Output Management supports main and sub documents. This manages the situation when
multiple LN reports are sent to the same spooler. These subdocuments are collected based on the
document identification, and merged into one PDF before being distributed.
There are also cases where during one print session, different LN reports are sent to different spoolers.
When the reports were shown in the UI, you would see different tabs with the different printed report.
An example is the Project Contract Acknowledgement with the Installments as possible addendum.
In Document Output Management you can specify to collect the different reports based on the document
identification and distribute them in one run. One report acts as the main report, the other reports are
distributed as attachments.
merged with the ordering of the attachments defined at the document type. When the ordering
is the same an addendum document precedes a document type attachment.
g.nr.files = 0
return(0)
store.file(i.filename, i.displayname)
return(0)
}
store.file(i.filename, i.displayname)
return(0)
}
Pre: -
Post: -
Input: - i.address - The address of the destination
Output: - o.error.msg - The error message if anything went wrong
Return: 0 if OK, otherwise the error code
EndFunctionUsage
g.folder = i.address
return(0)
}
for i = 1 to g.nr.files
ret = file.cp(g.filenames(1, i), path & "/" & g.displaynames(1, i))
return (0)
}
EndFunctionUsage
g.nr.files = 0
free.mem(g.filenames)
free.mem(g.displaynames)
return(0)
}
return(distribution.end(o.error.msg))
}
function store.file(
const string i.filename,
const string i.displayname)
{
domain tcmcs.str256m str fixed
INC(g.nr.files)
alloc.mem(g.filenames, len(str), g.nr.files)
g.filenames(1, g.nr.files) = strip$(i.filename)
alloc.mem(g.displaynames, len(str), g.nr.files)
g.displaynames(1, g.nr.files) = strip$(i.displayname)
2 Start the Custom Destination Types (ttrpi2554m000) session and create a new custom destination
type with these properties:
• Description: Filesystem Destination
• Custom Destination Type: FILESYSTEM
• Library: tccomdomdestfs
3 Use this custom destination type to send the document to the file system. How to do this depends
on your receiver type. If you use::
• Receiver type Contact, Business Partner or Employee, start the Document Management Output
Details (tccom6170m000) session. Add a new record for that receiver type and your document
type and destination type 'Custom' and custom destination type 'FILESYSTEM'.
• Receiver type User, start the User Document Type Settings (ttrpi2551m100) session. Open the
details of a specific user or all users and your specific document type. Add a new record with
destination type 'Custom' and custom destination type 'FILESYSTEM'.
4 Print to the Document Output Management device and view the result. Note that the documents
are stored on the file system in this directory: <bse_path>/dom.
Additional information
You can create your own destination type and use it for different document types and recipients. Create
a library with these functions, which will be run by the Document Distribution Engine:
• distribution.new
Syntax:
function extern long distribution.new(ref string o.error.msg)
Description:
Use this function to program the actions to be done before the
distribution is created.
Arguments:
o.error.msg: output parameter, which can be filled with an error
message if anything
went wrong.
Return value: 0 if processing without errors, otherwise the error code
• distribution.set.document.file
Syntax:
function extern long distribution.set.document.file(
const string i.filename,
const string i.displayname,
const string i.mime.type,
ref string o.error.msg)
Description:
Use this function to program the actions to be done to add the
document to the
distribution.
Arguments:
i.filename: input argument with the file name of the document
file.
i.displayname: input argument with the display name of the document
file.
i.mime.type: input parameter with the mime type of the document
file.
o.error.msg: output parameter, which can be filled with an error
message if anything
went wrong.
Return value: 0 if processing without errors, otherwise the error code
• distribution.add.attachment
Syntax:
function extern long distribution.add.attachment(
const string i.filename,
const string i.displayname,
const string i.mime.type,
ref string o.error.msg)
Description:
Use this function to program the actions to be done to add an
attachment to the
distribution.
Arguments:
i.filename: input argument with the file name of the attachment
file.
i.displayname: input argument with the display name of the
attachment file.
i.mime.type: input parameter with the mime type of the attachment
file.
o.error.msg: output parameter, which can be filled with an error
message if anything
went wrong.
Return value: 0 if processing without errors, otherwise the error code
• distribution.set.destination
Syntax:
function extern long distribution.set.destination(
const string i.address,
ref string o.error.msg)
Description:
Use this function to program the actions to be done to add a
destination address to the
distribution.
Arguments:
i.address: input argument with the address of the destination.
o.error.msg: output parameter, which can be filled with an error
message if anything
went wrong.
Return value: 0 if processing without errors, otherwise the error code
• distribution.send
Syntax:
function extern long distribution.send(ref string o.error.msg)
Description:
Use this function to program the actions to be done in case the
distribution is sent.
Arguments:
o.error.msg: output parameter, which can be filled with an error
message if anything
went wrong.
Return value: 0 if processing without errors, otherwise the error code
• distribution.end
Syntax:
function extern long distribution.end(ref string o.error.msg)
Description:
Use this function to program the actions to be done before the
distribution is finalized.
Arguments:
o.error.msg: output parameter, which can be filled with an error
message if anything
went wrong.
Return value: 0 if processing without errors, otherwise the error code
• distribution.cancel
Syntax:
function extern long distribution.cancel(ref string o.error.msg)
Description:
Use this function to program the actions to be done before the
distribution is cancelled.
Arguments:
o.error.msg: output parameter, which can be filled with an error
message if anything went wrong.
Return value: 0 if processing without errors, otherwise the error code
Note: Use this technique to create your own destination or send the documents to your own document
management system.
• You will create a new receiver type, to be able to send the document to the primary contact of the
shipment's carrier.
Complete these steps:
1 Create a new library tcmcsdomcarr with this content:
#include <bic_dom>
long destination
domain tccfrw carrier
domain tcmail email
dom.init()
carrier = i.receiver.value
email = get.email(carrier)
return (dom.get.document())
}
email = ""
select tcmcs080.suno
from tcmcs080
where tcmcs080._index1 = { :i.carrier }
as set with 1 rows
selectdo
select tccom120.ccnt
from tccom120
where tccom120._index1 = { :tcmcs080.suno }
as set with 1 rows
selectdo
select tccom140.info:email
from tccom140
where tccom140._index1 = { :tccom120.ccnt }
as set with 1 rows
selectdo
endselect
endselect
endselect
return (email)
}
2 Start the Custom Receiver Types (ttrpi2554m000) session and create a new Custom Receiver Type
with these properties:
• Custom Receiver Type: Carrier
• Description: Carrier
• Library: tcmcsdomcarr
3 Start the Document Types (ttrpi2510m000) session and open the details of Document Type
SHIPMENT.
4 Change these properties:
• Receiver Type: Custom
• Custom Receiver Type: Carrier
5 Save the record and click Validate to validate the document type.
6 Start the Report Rules (ttrpi2520m000) session and open the details for report whinh443511000.
7 Change the expression of the receiver field variable to:
table twhinh430
select whinh430.carr
from whinh430
where whinh430._index1 = {:whinh431.shpm}
as set with 1 rows
selectdo
return (whinh430.carr)
endselect
return(“”)
Additional information
You can create your own receiver. Create a library with this function, which will be run by the Document
Distribution Engine:
• dom.get.destinations
Syntax:
function long dom.get.destinations(
string i.doc.type,
string i.receiver.type,
string i.custom.receiver.type,
string i.receiver.value)
Description:
Use this function to add the destinations to the document.
Arguments:
i.doc.type: input argument which contains the document type
i.receiver.type: input argument which contains the receiver type
i.custom.receiver.type: input argument which contains the name of
the custom receiver
type, if applicable
i.receiver.value: input argument which contains the receiver value
as defined in the
report rule
Return value: xml node with the document, including the destinations
In this library some standard defines and functions can be used by including <bic_dom>. For a detailed
description of these defines and functions, see Appendix A.
To create your own e-mail solution, you must create a library in the Parameters (ttrpi2100s000) session.
Specify these functions, which will be run by the Document Distribution Engine:
• init.mail.message
Syntax:
function extern long init.mail.message(
ref string o.error.message)
Description:
Use this function to initialize the e-mail message.
Arguments:
o.error.message: output argument which contains the error message,
or an empty string
Return value: 0 if processing without errors, otherwise the error code
• set.mail.sender
Syntax:
function extern long set.mail.sender (
const string i.name,
const string i.address,
ref string o.error.message)
Description:
Use this function to add a sender to the email message.
Arguments:
i.name: input argument which contains the name of the sender
i.address: input argument which contains the mail address of the
sender
o.error.message: output argument which contains the error message,
or an empty string
Return value: 0 if processing without errors, otherwise the error code
• add.mail.recipient
Syntax:
function extern long add.mail.recipient(
const string i.role,
const string i.name,
const string i.address,
ref string o.error.message)
Description:
Use this function to add a mail recipient to the email message.
This function can be repeated to add more mail recipients.
Arguments:
i.role: input argument which contains the recipient’s role.
Possible values: to, cc, bcc
i.name: input argument which contains the name of the recipient
i.address: input argument which contains the mail address of the
recipient
• set.mail.subject
Syntax:
function extern long set.mail.subject(
const string i.subject.
ref string o.error.message)
Description:
Use this function to add a mail subject to the email message.
Arguments:
i.subject: input argument which contains the subject of the mail
message
o.error.message: output argument which contains the error message,
or an empty string
Return value: 0 if processing without errors, otherwise the error code
• set.mail.body
Syntax:
function extern long set.mail.body(
const string i.body.text.file,
const string i.mimetype,
ref string o.error.message)
Description:
Use this function to add a mail body to the email message.
Arguments:
i.body.text.file: input argument which contains the file name of
the body text
i.mimetype: input argument which contains the mime type of the
body text
o.error.message: output argument which contains the error message,
or an empty string
Return value: 0 if processing without errors, otherwise the error code
• add.mail.attachment
Syntax:
function extern long add.mail.attachment(
const string i.filename,
const string i.displayname,
ref string o.error.message)
Description:
Use this function to add an attachment to the email message.
Arguments:
i.filename: input argument which contains the name of the file.
• send.mail.message
Syntax:
function extern long send.mail.message(
ref string o.error.message)
Description:
Use this function to send the email message.
Arguments:
o.error.message: output argument which contains the error message,
or an empty string
Return value: 0 if processing without errors, otherwise the error code
• cancel.mail.message
Syntax:
function extern long cancel.mail.message(
ref string o.error.message)
Description:
Use this function to cancel the email message.
Arguments:
o.error.message: output argument which contains the error message,
or an empty string
Return value: 0 if processing without errors, otherwise the error code
• init.fax
Syntax:
function extern long init.fax(
ref string o.error.message)
Description:
Use this function to initialize the fax message.
Arguments:
o.error.message: output argument which contains the error message,
or an empty string
Return value: 0 if processing without errors, otherwise the error code
• add.fax.attachment
Syntax:
function extern long add.fax.attachment(
const string i.filename,
const string i.displayname,
ref string o.error.message)
Description:
Use this function to add an attachment to the fax message.
Arguments:
i.filename: input argument which contains the name of the file.
i.displayname: input argument which contains the name to be
displayed in the message
o.error.message: output argument which contains the error message,
or an empty string
Return value: 0 if processing without errors, otherwise the error code
• set.fax.number
Syntax:
function extern long set.fax.number (
const string i.fax.number,
ref string o.error.message)
Description:
Use this function to set the fax number.
Arguments:
i.fax.number: The faxnumber to which the fax must be sent.
o.error.message: output argument which contains the error message,
or an empty string
Return value: 0 if processing without errors, otherwise the error code
• send.fax
Syntax:
function extern long send.fax(
• cancel.fax
Syntax:
function extern long cancel.fax(
ref string o.error.message)
Description:
Use this function to cancel the fax.
Arguments:
o.error.message: output argument which contains the error message,
or an empty string
Return value: 0 if processing without errors, otherwise the error code
#include <bic_dom>
meta.node = dom.provider.metadata.init()
path", meta.node)
dom.provider.metadata.add.field("extension", "Extension", "ttst10",
meta.node)
return (meta.node)
Pre: -
Post: -
Input: -
Output:
Return: domain ttxmlnode an XML node containing the meta data
describing the
document provider
EndFunctionUsage
meta.node = dom.provider.metadata.init()
return (meta.node)
}
1 Ensure that the provider fields are specified with data. Provider fields are either table fields or external
program variables.
2 Call the dom.add.external.document method in bic_dom to add a document.
For each call one batch with one document in it will be created.
The dom.add.external.document function has this syntax:
Syntax:
function extern long dom.add.external.document(
const string i.doc.provider,
const string i.doc.provider.context,
const string i.file.name,
const string i.language,
boolean i.own.transaction,
ref string o.error)
Description:
Add a rendered document to Document Output Management (DOM). The given
language is used to select language dependent DOM document type
parts. A batch is created with one document
Precondition:
The given document provider exists and a valid document provider rule
exists.
Postcondition:
The document given in i.file.name is added to DOM as rendered document
and is ready for distribution.
Arguments:
i.doc.provider - The DOM Document Provider
i.doc.provider.context - The Document Provider context used to
differentiate in DOM
expressions.
i.file.name - The rendered document to be added. This includes the
path on the LN server.
i.language - Language to be used for selection of language dependent
document type
parts.
i.own.transaction - whether or not the changes have to be commited
to the database
o.error - Error message in case of an error.
Return value:
long 0 in case document has been added, <0 when not OK
-1 Document Provider not found
-2 Document Provider Context not found
-3 Document Provider rule problem
-4 Document type used in document provider rule not found
-5 Batch cannot be created in DOM
-6 Problem in getting keywords from document provider rule object
-7 Document cannot be created in DOM
-8 Document Variables cannot be created in DOM
-9 Problem in initializing document distribution
-10 Most likely given file cannot be attached as BLOB
Document Management System (DMS) is used to track, manage and store documents. With Document
Output Management (DOM) you can store documents in DMS or attach an already stored document
to the distribution of a document.
To communicate with the DMS, DOM uses the Document Hub, which is a tool to map Applications to
Document Management Systems. The Document Hub currently supports these DMSs:
• Infor Document Management (IDM)
• Object Data Management (ODM)
We will explain how to set up the Document Hub and how documents can be stored in DMS and how
they can be reused. The Request for Quotation document is used as an example.
You can also use your own document solution to store the DOM documents by creating a custom
destination. For more information, see "Advanced Options" on page 27
For each mapping also a DMS attribute called externalApplication is created. This attribute must
get a Mapping Type fixed value with the value of an external application being defined in ODM. Use
the External Applications (dmcom3100m000) session. The external application is only used when
uploading documents to ODM. It defines defaults to be used in ODM for the upload.
To print an RFQ document using Document Output Management and store it in the IDM archive.
Preparation
Use the RFQ document type, you created earlier.
To map the application attributes to the document management system (DMS) attributes:
1 Start the Document Mapping (ttdms3550m100) session and select application infor.ln.dom.
2 Add a new record to the Application Tables. Specify this property:
• Table Name: tdpur105
Additional information
When a document type status is Ready to Use, the application can use the Document Hub to store
documents in the document management system (DMS) or retrieve documents from the DMS. If a
document type does not have status Ready to Use, use the Validate option to search for issues.
Each document type attribute must be mapped to either an application attribute or a fixed value. When
mapping is not possible, the mapping type can be switched to Application UI. In that case it is up to
the application to have the attribute filled by the application user.
3 On the Receiver Independent Destinations tab, add a record with these properties to link an
archive specification to a destination:
• Destination Type: Document Management System
• Address: dms
4 Open the Archive Specification and on the Attributes tab, specify the Mapping fields to link the
DMS document type attributes to the LN document variables.
Note:
The id1 - id2 attributes are reserved for the primary key fields of the LN table. For example table
tdpur105 has two primary key fields; therefore only id1 and id2 must be filled.
5 Save this Archive Specification and click Validate to validate the document type.
6 Run the Requests for Quotation session. Print a request to the Document Output Management
device and verify whether the document is stored in DMS.
Additional information
To use multiple archive specifications, you must create multiple receiver independent destinations on
the Receiver Independent Destinations tab. The condition expression of the receiver independent
destination determines which archive specification is used.
• Add an extra part to the RFQ document type, which will be added as additional document. This
additional document is linked to the business partner and stored in DMS.
Complete these steps:
1 Start the Document Types (ttrpi2510m000) session.
Select the RFQ document type and open its details.
2 On the Parts tab, create a part with these properties:
• Description: BP specific terms
• Destination Type: All
• Part Type: Existing Document(s)
• Expression:
dom.dochub.list.init("tccom400", "MDS_GenericDocument")
dom.dochub.list.add.attribute.filter("id1", #bp#)
dom.dochub.list.set.filename.filter("Terms*.jpg")
nr.of.documents = dom.dochub.list.execute()
if nr.of.documents <> 1 then
return (false)
endif
ret = dom.dochub.get.document(dom.dochub.get.document.id(1), path)
if ret >= 0 then
dom.add.document.to.distribution(path,
dom.dochub.get.document.filename(1),
dom.dochub.get.document.mimetype(1))
return (true)
endif
return (false)
Additional information
You will notice that an extra document is attached to the e-mail, which was linked to the business
partner and stored in the DMS.
In the expression of this new part, the document is read from the DMS using the filename of the
document. It is therefore very important to use naming conventions for the file names.
Note: this is a simplified example. In reality there can be multiple documents.
When attaching documents from IDM, these functions are available:
• dom.dochub.list.init
Syntax:
function long dom.dochub.list.init(string i.table, i.doc.type)
Description:
Initializes the List Documents request.
Arguments:
string i.table
the LN Table
string i.doc.type
the DMS Document Type, can be empty
Return value: 0, or -1 if an error occurred
• dom.dochub.list.add.attribute.filter
Syntax:
function long dom.dochub.list.add.attribute.filter (string i.
appl.attr.id, string i.attr.value)
Description:
Adds an attribute filter to the List Documents request.
Arguments:
string i.appl.attr.id
the application attribute ID
string i.attr.value
the attribute value
Return value: 0, or -1 if an error occurred
• dom.dochub.list.add.filename.filter
Syntax:
function long dom.dochub.list.add.filename.filter (string i.
filename)
Description:
Adds a filename filter to the List Documents request.
Arguments:
string i.filename
the filename, a regular expression
Return value: 0, or -1 if an error occurred
• dom.dochub.list.add.mimetype.filter
Syntax:
function long dom.dochub.list.add.mimetype.filter (string i.
mimetype)
Description:
Adds a MIME type filter to the List Documents request.
Arguments:
string i.mimetype
the MIME type, a regular expression
Return value: 0, or -1 if an error occurred
• dom.dochub.list.execute
Syntax:
function long dom.dochub.list.execute()
Description:
Executes the List Documents request.
Return value: the number of documents found, otherwise <0
• dom.duchub.get.document
Syntax:
function long dom.dochub.get.document (long i.unique.ident ,
ref string o.result.file)
Description:
Use this function to retrieve one document from DSM and store
it as a temporary file.
Arguments:
long i.unique.ident
the internal DMS document ID
ref string o.result.file
the temporary file (including path), which
contains the downloaded
DMS document
Return value: 0 if document retrieved, otherwise -1
• dom.dochub.get.document.attribute
Syntax:
function string dom.dochub.get.document.attribute (long i.entry,
string i.
attribute)
Description:
Use this function to retrieve the value of a document attribute
from DMS.
Pre:
• dom.dochub.get.document.id
Syntax:
function string dom.dochub.get.document.id (long i.entry )
Description:
Use this function to retrieve an internal ID of a document from
DMS.
Pre:
Call dom.dochub.list.execute before this method to retrieve the
list of documents.
Arguments:
long i.entry
The index of the DMS document
Return value: the ID of the document, or empty of an error occurred
• dom. dochub.get.document.filename
Syntax:
function string dom. dochub.get.document.filename (long i.entry)
Description:
Use this function to retrieve the filename of a document from
DMS.
Pre:
Call dom.dochub.list.execute before this method to retrieve the
list of documents.
Arguments:
long i.entry
The index of the DMS document
Return value: the filename of the document, or empty of an error
occurred
• dom.dochub.get.document.mimetype
Syntax:
function string dom.dochub.get.document.mimetype (long i.entry)
Description:
Use this function to retrieve the mime type of a document from
DMS.
Pre:
Call dom.dochub.list.execte before this method to retrieve the
list of documents.
Arguments:
long i.entry
The index of the DMS document
Return value: the mime type of the document, or empty if an error
occurred
• dom.add.document.to.distribution
Syntax:
function long dom.add.document.to.distribution (string i.tempfile,
string i.name,
string i.
mimetype)
Description:
This function adds an existing document from IDM to the list of
distributions.
Arguments:
string i.tempfile
The name of the IDM document to add (including
path)
string i.name
The display name of the IDM document to add
string i.mimetype
The mime type of the IDM document to add
Return value: 0 in case of success, otherwise -1
Use this troubleshooting information as a resource to help you solve specific problems you can encounter
when using Document Output Management.
Logging
When you are troubleshooting, log files can help you.
To get more logging information, you can set these environment variables:
• RPI_SERVER_LOGGING=1
Logs information from reporting or dom processes in $BSE/log/log.rpi
• DOM_TRACE=<N>
Logs information from scheduler process in $BSE/log/log.rpi
• N=1: Errors are logged
• N=2: Informational messages
• N=3: Debug level
In case of issues also check the $BSE/tmp/bshell.<pid> file and the $BSE/log/log.bshell
file.
Debugging
To detect problems in expressions or custom libraries, you can use Infor LN Studio for debugging
purposes.
Custom implementations
You can debug custom implementations, such as custom destination types, custom e-mail
implementations, and custom fax implementations, using Infor LN Studio. These custom implementations
are libraries that are called by these sessions:
• Document Rendering and Distribution (ttrpi3210m000)
• Documents (ttrpi3510m000) - Select the View Document action.
The custom receiver type implementation is called during printing of the original LN report to the
Document Output Management device.
Complete these steps:
1 Set breakpoint in library.
2 In case of Web UI, create a launch configuration for one of the sessions mentioned earlier and
launch that session in debug mode from Infor LN Studio.
3 In case of LN UI, start the Debug and Profile 4GL (ttadv1123m000) session.
Select your activity and select the debug check box. Click OK. Start one of the sessions mentioned
earlier from LN UI.
Expressions
You can debug the expressions defined for document types and report rules using Infor LN Studio.
Actually these expressions are compiled into objects. The generated source code of these document
type objects and report rule objects is visible in Infor LN Studio.
On the Overview page of the LN Report in Infor LN Studio the different Document Output Management
Sources, which are applicable for this LN Report, are displayed. Click the link related to this source to
open the source editor and set a breakpoint.
The document type expressions are called during the preparation phase (printing the LN Report) to
determine the printer devices, and during the distribution phase to handle mail from addresses, receiver
independent destinations, existing documents, and so on.
Report rule expressions are called during the selection of a device (to select the applicable report rule),
and during printing the LN Report to map the correct report values to document variables.
bic_dom
The <bic_dom> include contains these defines:
Syntax:
function extern dom.init()
Description:
Initializes the document.
• dom.destination.new()
Syntax:
function extern long dom.destination.new (
const string i.destination.type,
[const string i.custom.code])
Description:
Creates a new destination and adds it to the document created
by dom.init(). This can
be repeated to add multiple destinations to the document.
Arguments:
i.destination.type: input variable, which contains the destination
type, use one of these
values:
DOM_DESTINATION_TYPE_EMAIL
DOM_DESTINATION_TYPE_FAX
DOM_DESTINATION_TYPE_PRINT
DOM_DESTINATION_TYPE_CUSTOM
i.custom.code: input variable, which contains the custom code,
if applicable (optional)
Return value:
Returns an xml node containing the newly created destination or
0 (zero) if the
destination could not be created.
• dom.destination.set.address()
Syntax:
function extern void dom.destination.set.address(
long i.destination,
const string i.address)
Description:
Sets the address for a given destination.
Arguments:
i.destination: input variable, which contains the destination
created by
dom.destination.new()
i.address: input variable, which contains the address to set
• dom.destination.set.additional.address()
Syntax:
function extern void dom.destination.set.additional.address(
long i.destination,
const string i.address,
boolean i.is.bcc)
Description:
Sets the additional address for a given destination. This can
be repeated to add multiple
additional addresses to the destination.
Arguments:
i.destination: input variable, which contains the destination
created by
dom.destination.new()
i.address: input variable, which contains the additional address
to set
i.is.bcc: input variable (true/false) to set whether the
additional address is a bcc (blind
carbon copy) or a normal cc (carbon copy)
• dom.get.document()
Syntax:
function extern long dom.get.document()
Description:
Retrieves the document.
Return value:
Returns an xml node which contains the document. In case of an
error, the function will
return an xml node containing the error message.
• dom.errormessage.set()
Syntax:
function extern void dom.errormessage.set(const string i.error.
message)
Description:
Creates an error message for a document. Already added
destinations will be removed.
Arguments:
i.error.message: input variable which contains the error message.
• dom.provider.metadata.init()
Syntax:
function extern long dom.provider.metadata.init()
Description:
Initializes the DOM Document Provider meta data structure.
• dom.provider.metadata.add.field()
Syntax:
function extern long dom.provider.metadata.add.field (string i.
id, string i.description, string i.domain, long io.metadata)
Description:
Adds a provider data field to the meta data.
Arguments:
i.id: Name of the provider data field.
i.description: Description of the provider data field.
i.domain: Domain of the provider data field.
io.metadata: Node created by dom.provider.metadata.init().
• dom.provider.metadata.add.context ()
Syntax:
function extern long dom.provider.metadata.add.context (string
You can use these variables during distribution. You can use them in expressions linked to the Document
Type:
• dom.document.language
• dom.document.company
• dom.document.reportcode
• dom.batch.user
• dom.batch.session
• dom.batch.context (the context specified by a Document Provider)
• dom.destination.name (the name specified at the Receiver Independent Destination)
• dom.destination.type (the constant names of the ttrpi.dest domain)
• dom.destination.custom
• dom.destination.address
• You can also use the ## expression. The text between the ## is converted to a document type
variable and must be mapped to a report variable in the report rule.
You can use these variables in expressions linked to the Report Rule:
• dom.batch.session
• dom.batch.session.pid
• dom.report.language
You can use these variables in expressions linked to the Document Provider Rule:
• dom.batch.context (the context specified by a Document Provider)
• dom.batch.language (the language specified by a Document Provider)
You can use these functions in expressions linked to the Report Rule:
• get.keyword1()
• get.keyword2()
• get.keyword3()
• get.keyword4()
• get.<report rule variable>()
These variables are used as special parameter setting during printing:
• splitfield; When the content or value of the expression in 'splitfield' changes, printing will continue
in a new separated document.
• font.scaling; the value of this variable is used for the font scaling. Possible values are:
• 'blank': No font scaling
• > '2' font scaling factor.
• < '2' default font scaling factor '9' will be used.
Depending on the fax solution provider, you must configure the fax settings differently:
• Send an e-mail with attachments.
• Specify the fax number in the e-mail address or e-mail subject.
• Examples:
• #FAXNUMBER#@efaxsend.com
• #FAXNUMBER#-<security code>@informmaxion.faxservice.nl
• [email protected] and mail subject contains
<security-code>;#FAXNUMBER#;#subject#
You can start the Document Rendering and Distribution session from the command prompt.
The session can be started with this command:
On UNIX/Linux:
bshell6.2 -server ttrpi3210m000 <options>
On Windows:
ntbshell -server ttrpi3210m000 <options>
This table shows the options you can use:
In case no options are specified, the session is started with the default values. Rendering and distribution
is processed once. After that the session will close.