Book Contents

Book Index

Communication

Book Contents

Book Index

Letter mail

Export of consignments using the PostServis service

Process number: CRM006

Script ID No.: FCRM056

File: PostService.PAS

Script description: Script for exporting letter mail to the PostServis service.

Address in the tree:

Script parameters:

EnvelopeType - 0

Type of the exported consignment. If this parameter is entered, the script takes the parameter value with priority. If the parameter is not entered, the value from the Consignment category field is filled in.

 

Possible parameter values:

 

  • 165 - Registered Europe
  • 169 - Registered
  • 171 - Registered with advice of delivery
  • 172 - Registered with advice of delivery, to be delivered into the addressee's own hands
  • 173 - Registered with advice of delivery, to be delivered into the own hands of the addressee only
  • 175 - Registered, to be delivered into the addressee's own hands
  • 176 - Registered, to be delivered into the own hands of the addressee only
  • 194 - Ordinary Europe
  • 195 - Ordinary

UserName

User name for the PostServis service.

Password

User password for logging in to the PostServis service.

PrintType - 0

Parameter for specifying the method of printing the document. 0 - single-sided printing, 1 - double-sided printing.

TestMode - NO

If the parameter is set to Yes, the document is sent to the test environment of the PostServis service.

WriteNoteToDoc - YES

If the parameter is set to Yes, a note about the export of the document to the PostServis service is added to the outgoing letter mail document.

SilentMode - No

If the parameter is set to Yes, no confirmation messages are displayed while the script and export are running. Only a log file with any errors is created.

Using this script, we export outgoing letter mail envelopes and their attachments to the PostServis service. This service is provided by Česká pošta (Czech Post). The customer hands over the data for processing in electronic form and Postservis prints them and puts them into envelopes – i.e. transforms them into physical form. The produced consignments are immediately handed over for delivery. In this way, up to 8 "*.pdf" files with 8 A4 sheets can be sent.

For a consignment to be exported, the Partner or Contact person of both the Addressee and the Sender must be filled in the outgoing letter mail document. Their addresses must also be filled in there. Before the export, the user name and password for logging in to the PostServis service must be set using the parameters. The type of the exported consignment must also be set (by a script parameter or in the Consignment category field).

The script can be run over one outgoing letter mail document (envelope), over marked records or over a filter. After start, the envelopes with all attachments in "*.pdf" format are exported to the PostServis service. The attachments are always exported in the order in which they were attached to the document. They will also be printed and included in the consignment by the PostServis service in this order.

Create letter from document

Process number: CRM006

Script ID No.: FCRM036

File: Sale_CreateEnvelopes.PAS

Script description: Creating an outgoing letter mail envelope from sales documents and reminders in IS K2.

Address in the tree:

Script parameters:

AbbrOfActivity

Activity abbreviation. The value from the parameter is pre-filled in the Abbreviation field in the form.

ActivityComment

Comment on the activity. The value from the parameter is pre-filled in the Comment field in the form.

AddAdr - No

Yes - if the address (postal code) of the addressee does not exist in the new addresses, the script creates it; No - the address is not created and the letter mail document is created without the addressee's address.

AddressType - 2

Type of address. 1 - Invoice; 2 - Delivery.

Book - OV

Parameter for choosing the marketing book in which the Outgoing letter mail documents will be created.

Campaign

Activity campaign. The value from the parameter is pre-filled in the Campaign field in the form.

CD1 - No

Yes - letter mail documents are created for the customer's headquarters; No - letter mail documents are created for the Suppl./Cust. from the document.

CountSheetsInEnvelope - No

Yes - when grouping attachments into an envelope with a set maximum number, sheets are counted. No - when grouping attachments into an envelope, pages are counted.

CreateActivity - No

Yes - the script creates activities for the Outgoing letter mail documents; No - activities are not created.

DateFromActivity

Date from in the activity. The value from the parameter is pre-filled in the Date from field in the form.

DateToActivity

Date to in the activity. The value from the parameter is pre-filled in the Date to field in the form.

DescriptionOfActivity

Activity description. The value from the parameter is pre-filled in the Description field in the activity.

Document - No

Yes - the report specified in the ReportForPDF parameter is exported to the "*.pdf" format and the document is attached on page 9 of the created letter mail document; No - the export is not performed.

KindOfShipment - 2000000235 (Registered consignment)

Consignment category. It is filled in the header of the created Outgoing letter mail document.

Opportunity

Activity opportunity. The value from the parameter is pre-filled in the Opportunity field in the form.

PagesInEnvelope - 0

Maximum number of pages or sheets in one envelope. If the parameter is set to 0, the documents are not grouped.

Proof - No

Yes - the created Outgoing letter mail document and the document from which the envelope is created are linked via their pages 9; No - these documents are not linked.

Protocol - No

Yes - after the records are created, a detailed log of the created documents or activities is displayed; No - the log is not displayed.

ReportForPDF

Parameter for specifying the name of the report that will be exported to the "*.pdf" format.

ResponsiblePersonOfActivity - 1

Responsible person of the activity. The value entered in this parameter is pre-filled in the Responsible person field in the form.

TypeDocument

Type of document (attachment on page 9 of the document).

TypeOfActivity

Type of activity. The value from the parameter is pre-filled in the Type of activity field in the form.

TypeOfExport - 1

1 - export by Supplier/Customer; 2 - export by Document.

TypeOfShipment - 108 (Invoice in)

Type of letter that is inserted into the item of the Outgoing letter mail document.

LocateLhefolder - 1

Activity folder. The parameter value is pre-filled in the Folder field in the form. The created activity is placed in this folder.

DescriptionOfDocument

The value from the parameter is pre-filled in the Description from document field in the form. If the user writes any text in this parameter, the Description from document check box will not be set in the form and this text will be inserted into the Description field in the header of the created Outgoing letter mail documents. If no value is filled in this parameter, the Description from document check box is set in the form and the description from the sales documents or reminders is filled in the headers of the created documents.

Using this script, records (letters) can be created in the Outgoing letter mail book directly from sales documents in IS K2 and from records in the book of reminders. This script can be run over all sales documents and reminders. After the script is started, a user form is displayed where you can set some details necessary for creating the Outgoing letter mail document.

Linked Graphics K2_SKRIPT

Picture: Creating new mail from a K2 document form

The documents over which the script is run are loaded into the form, i.e. if the script is run over a book, the documents of the whole book are loaded into the form. If the script runs over one document, there will be only one item in the form. If some documents are marked with an asterisk, the script loads only these records. After the records are loaded, all of them are marked with an asterisk in the form. This marking can be adjusted using the standard asterisk icons or the key combinations Shift+Enter and Ctrl+Space. Letter mail documents are then created only for the marked records.

Using the PagesInEnvelope parameter, attachments in the form of "*.PDF" files can be grouped. This grouping works only with the export type by Document. The attachments are then grouped into outgoing letter mail envelopes by Suppl./Cust. and Address. The PagesInEnvelope parameter determines the maximum number of pages or sheets in one created envelope. If the parameter is set to 0, the documents are not grouped. This grouping can be used, e.g., for the export to the PostServis service.

Description of fields:

Address of parent co.

If the field is checked, the script creates the Outgoing letter mail document for the customer's headquarters (the address of the headquarters is inserted into the Addressee field).

Create activity

The script also enables creating activities for the individual letter mail envelopes. When this field is checked, the Activities tab is displayed in the form, where basic data about the activity can be entered.

Protocol

Check box that determines whether a detailed log of the created Outgoing letter mail envelopes and new activities is displayed after the records are created.

Document on page 9

When this field is checked, the resulting Outgoing letter mail documents will be linked with the sales documents or reminders via their pages 9.

Ext. document on page 9

The field is accessible only if the ReportForPDF parameter is set, in which the name of the report for export to the "*.PDF" format must be entered. If the Document on page 9 field is checked, the specified report is exported to "*.PDF" and this document is placed on page 9 of the resulting letter mail document.

Export type

The export type by Document creates a new envelope with the relevant item in the Outgoing letter mail book for each marked document in the form. If the export type by Supplier/Customer is set, the documents in the form with the same customer are grouped and an Outgoing letter mail envelope is created for them with items whose number corresponds to the number of grouped documents.

Type of address

The script supports extended addressees in IS K2. In this field, you can select the address type of the addressee of the resulting document in the Outgoing letter mail book.

Type of letter

Field for selecting the type of letter that is inserted into the item of the letter mail document.

Book

Field for selecting the marketing book in which the Outgoing letter mail documents will be created.

Consignment category

Field for choosing the consignment category. The value is inserted into the header of the resulting letter mail document.

Description from document

If this field is checked, the description from the sales document or reminder is inserted into the header of the created Outgoing letter mail document. If this field is not checked, the text entered here is filled in the header of the Outgoing letter mail documents.

Save as script parameters

Pressing this button saves the script parameters. The parameters are set according to the values filled in the form.

When the Create activities field is checked, another tab, Activity, is displayed in the form. Here you can predefine the fields for creating activities.

Linked Graphics K2_SKRIPT

Picture: Creating new mail from a K2 document form - Activity tab

The user can fill in the relevant values in the fields on this tab of the form, and these are then inserted into the newly created activities. These are the fields Type of activity, Abbreviation, Description, Place in folder, Campaign, Opportunity, Date from, Date to, Responsible person and Comment.

After pressing the OK button in the form, documents are created in the Outgoing letter mail book, or the defined activities are created.

Change of posting number

Process number: CRM006

Script ID number: FCRM030

File: ChangeFilingNumber.pas

Script description: The script enables changing or entering some fields of the envelopes in the posting sheet.

Address in the tree:

Script parameters:

No parameters.

Using this script, some fields in the items of the posting sheet, i.e. in the envelopes included in it, can be changed in bulk. The fields Posting number, Weight, Service price, Declared value and Paid in cash can be changed in bulk. The envelopes in the posting sheet have already been confirmed once. After the fields are filled in by this function, the envelope is automatically confirmed a second time.

The script can be run over a specific posting sheet. After start, a form is displayed listing all items of the sheet, i.e. the individual consignments.

Linked Graphics K2_SKRIPT

Picture: Change of posting number form

For the displayed items, the relevant values of the individual fields can be entered in the editable columns of this form. The values in these columns can be changed using the Enter key. The operator saves the entered values using the OK button.

Book Contents

Book Index

Česká pošta Letter mail - Set parameters for communication

Process number: CRM013

Script ID number: FCRM

File: CeskaPostaApiSettingsLetterPost.pas

Script description: The script is used to save the configuration for communication with Czech Post and to set the properties of letter consignments. The consignment property values entered here take precedence over the values entered in a specific outgoing mail record (e.g. Consignment category (registered letter)). The settings are saved for the individual Books of letter mail. So if communication settings for Czech Post exist for a specific book of letter mail, the data for Czech Post are sent automatically upon the first confirmation of the outgoing mail record. The rows of the individual settings are added with the Insert key.

Address in the tree: Communication / Letter mail / Sent / Czech Post - Parameter settings for communication.

Selected script parameters:

Display a form with settings when confirming a consignment - No

Yes: Upon the first confirmation of a consignment, when data are sent to Czech Post, a form with selected fields is displayed; for the data record being created, these fields can be filled with data that are not filled in the current consignment or that are to be changed.

Book of letter mail - ' '

Book of letter mail for which the settings will apply.

Sender identification section

The required fields must be filled in with data that the client obtains from Czech Post:

  • URL for communication
  • API key
  • Secret key
  • Technological number of the sender
  • Zip code of post office
  • Customer CČK ID

Posting point number - ' '

Using the Create posting point button, you must register your company (posting point) with Czech Post. It is mandatory to fill in the sender's address and also the address of the recipient of the cash-on-delivery amount. (The address from the saved posting point is used as the sender's address in the data record and on the label - not the address specified in the consignment.)

Caution: Once a posting point has been created, it cannot be edited afterwards, e.g. to add further data. Only a new posting point can be created. We therefore recommend filling in the form properly with all data. The OK button closes the form and registers the posting point. The posting point number is automatically filled in the Posting point number field in the main form.

Note: The list of other posting points we have registered can be called up with the Show list of posting points button. Invalid or unused posting points can be cancelled using the Czech Post - Cancel selected posting point script.

Settings for fields and services section

Type of letter (prefix) - ' '

For letter mail, e.g. "RR" (registered letter), or the program name of a field from the Outgoing letter mail module from which the value is to be read can be specified in square brackets. External fields and links can also be entered (a link is defined with the ";" character). If it is not filled in, the value is read from the Kind field of the letter mail. The type of letter is mandatory for sending the data.

Additional services - ' '

Required additional services. We enter the individual numbers or letters of the services separated by "+". The services (in the same format) can be entered directly in the selected field (including an external one) directly in the consignment, and the name of the program field is then specified here in square brackets. A link is defined with the ";" character.

Note: It is advisable to discuss the use of services with the Czech Post sales representative with whom the client deals. For letter mail, e.g. for the "RR" kind (registered letter), one of the services 50 to 60 must be specified.

Printing labels section

Do not display or print when confirming the document - No

Yes: Upon the first confirmation of the consignment, the label is neither displayed in the PDF viewer nor sent to the printer.

No: Display or printing is governed by the "Show preview" parameter.

Show preview - No

Yes: Displays a preview of the label in the PDF viewer. Either in the viewer specified in the "Command line for starting printing" parameter or, if it is not specified, in the default viewer.

No: Printing is performed directly to the printer.

Name of printer - ' '

Wildcards can also be used in the printer name, e.g.: :\\ANUP.k2.int\M452*

Command line for starting printing - ' '

Link to the executable file of the PDF program in which the labels are to be displayed.

Example entry: C:\Program Files\Tracker Software\PDF Viewer\PDFXCview.exe

Command line parameters for printing - ' '

Specification for sending the label print from the PDF program to the printer.

Example entry for PDF Viewer: /printto "%s" "%s"

Label type

Selection of the required label. For letter mail, e.g. the label Id 39 is suitable.

Data Box - Reading and Writing Messages

Process number: CRM011

Script ident. no.: FCRM034

File: DataboxMessages.pas

Script description: The script allows messages (including delivery receipts) to be downloaded from a data box and saved to K2 - the Letter mail book.

Address in the tree: [Communication] [Data box]

Script parameters:

K2DocType - DS_DOC

The document type in which the data message will be saved as a full-text file with attachments.

DocAbbrPrefix - DS_

Prefix of the message file name.

MaxMsgCount - -1

Maximum number of downloaded messages. The default value -1 means all messages.

DateFrom - 1.8.2009

"Date from" for downloading messages. Determines the oldest messages to be downloaded.

DeliveredFilesDocType - Document type for saving files as separate documents. It is set if the SaveDeliveredFiles parameter is set to YES. If the parameter is not set, the attachments are set with the same type as the message itself.

CertificateName - K2UniversalED

Name of the certificate for encrypting the message. Empty = the message file is not encrypted.

LoginCertificateThumbPrint -

Cryptographic thumbprint of the login certificate, if a certificate is used to log in to the data box. This thumbprint can be obtained in the details of the given certificate in Windows; however, it must be copied via e.g. Notepad because invisible characters get inserted, which make it invalid.

LoginIdIO - 2000034154

Number of the web record with the login credentials for the data box. The default value sets the standard system record ISDS.

ReceiveSenMessages - No

The parameter determines whether sent messages are also to be downloaded from the data box (Yes) or not (No).

ErrorLogShow - No

The parameter determines whether the error log of message processing is to be displayed on the screen (Yes) or whether it is sufficient to save it to the recalculation error log - type 15 (No).

ErrorLogFileName -

File name including the path for saving the message processing error log, if a file is to be created.

ReceiveDeliveryInfo -
Download also message delivery receipts - processes the downloaded messages and adds events from the delivery receipts

SaveDeliveredFiles - No

Yes - Attach attachments as separate documents. When set to YES, the files contained in the message are attached to this message (record) on the Attachments page in the Letter mail book when the message is downloaded to K2.

K2DelInfoType -
Document type for saving the delivery receipt file to K2

CounterpartyDataBox - Identifier of the counterparty's data box

The data box identifier is entered in the parameter value. Only received messages from this sender are then downloaded to Letter mail.