Description
The Doc config items are part of the config DocExt and describe the documents' type ( form ) in itself. For a whole document the config items defines its checking for uniqueness, the allowing to be changed or deleted ( locking ), the logging of changes etc. For a document's field the config item checks it for the filling and valid value.
The Doc config items you should type on the tab Doc of a config DocExt. Use new line for each item. The first items configure a document as a whole and each next item configures a document's field.
To the items Doc you can address each time before the saving a document.
Item's Format
Use first items ( lines ) of a config Doc to configure a document as a whole.
The format of an item configuring a document:
TYPE[ name ] NAME{ formula } LOG_FIELD[ name ] LOG_APP[ name ] LOG_MAIL[ subtags ] LOCK{ condition } LOCK_D4D[ name ] UNIQ_D4D[ name ]
The format description:
TYPE[ name ] - defines the type name of a document that will be displayed before the document name in a message at a code running. If you omit the tag the document's form name will be used;
NAME{ formula } - computes the name of a document for a message at a code running. If you omit the tag the document's UNID name will be used;
LOG_FIELD[ name ] - defines the field what the document's updating log will be stored to. If you omit the tag the default field name will be used ( is set by the const DE_LOG_FIELD in the Library ). If you don't want to log changes to a field use the empty in the tag;
LOG_APP[ name ] - defines the app ( in a project ) what a document's update log will be stored to. The projects and their apps are defined in the Project type configs. If you omit the tag the default app name will be used ( is set by the const DE_LOG_APP in the Library ). If you don't want to log changes to an app use the empty in the tag;
LOG_MAIL[ subtags ] - defines the notice sending about a document changing. The tag contains the subtags inside:
LOG{ condition } - defines when the notice will be sent. The condition is checked on the log document ( but not on changed document ) with the one field Message with the content of changes;
DOC{ condition } - defines when the notice will be sent. The condition is checked on the changed document;
TO[ address ] - defines a notice recipient. You can type TO{ formula } to compute ( on the changed document ) an one or more e-mail addresses;
SUBJ[ text ] - defines the message subject. It will be appended to the changed document's name computed by the tag NAME{ formula }. Type the tag SUBJ{ formula } to compute the subject on the changed document.
LOCK{ condition } - defines when a document is locked that forbids its editing and deletion. The condition result @True (1) or not empty text for a document locks it. The text will be added to the message box. You also can use the tag in a field's config item;
LOCK_D4D[ name ] - works like LOCK{ condition } but a document is locked when the documents by the config item DocForDoc are got. You also can use the tag in a field's config item;
UNIQ_D4D[ name ] - defines that a document is not unique if the documents by the config item DocForDoc are got. It's recommended use the tag in a field's config item.
The fields' config items should place under the document's ( first ) config items.
The format of a field's config item:
name [ description ] LOCK{ condition } LOCK_D4D[ name ] FILL FILL{ condition } FAIL{ condition } FAIL_D4D[ name ] VLD{ condition } VLD_D4D[ name ] UNIQ_D4D[ name ] UNIQ UNIQ{ condition }
The format description:
name - the name of a field which should be configured;
[ description ] - the description of the field. It will be used for a code running message and updates logging;
FILL - defines that the field must be filled;
FILL{ condition } - defines when the field must be filled;
FAIL{ condition } - defines when the field value is not valid;
FAIL_D4D[ name ] - means a value of the field is not valid if the documents by the config item DocForDoc are got;
VLD{ condition } - defines when the field value is valid;
VLD_D4D[ name ] - means a value of the field is valid only if the documents by the config item DocForDoc are got;
LOCK{ condition } - defines when a document is locked that is can't be edited and deleted;
LOCK_D4D[ name ] - works like LOCK{ condition } but if the documents by the config item DocForDoc are got;
UNIQ_D4D[ name ] - means a document is not unique if the documents by the config item DocForDoc are got. Use the tag for the first field taking part in the tag KEY of the config item DocForDoc;
UNIQ - type this tag if the field takes part in all configs items DocForDoc specified in a tag UNIQ_D4D of other config items above;
UNIQ{ condition } - works like UNIQ but only if the result of the condition is @True (1).
For all formulas and conditions in the config tags are expected the results: @True (1), @False (0) or not empty text. If is got an expected result the message box with description and value of the field will be displayed. if the result is not empty text then it will be added to the message box.
The tags LOCK_D4D, FAIL_D4D, VLD_D4D, UNIQ_D4D can be used more than one time in a config item. Moreover, for the tags you can use the extended form of calling a config item DocForDoc: ...[ SRC{ condition } name TRG{ condition } ] - where condition in the tag SRC will be applied to the source document ( which is being checked ) and only if the result of the condition will be @True (1) the getting of documents by DocForDoc config with the specified name will be done. Type a condition in the tag TRG to check it on the got documents - only ones with check's result @True (1) will remain as the result.
Topic links:
See also: