Description
The DocForDoc config items are part of a config DocExt and describe how one document gets others. The config items grants many capabilities for the easy getting and picking documents from views in your apps.
The DocForDoc config items you should type on tab DocForDoc of a config DocExt. Use new line for each item. The first item configures defaults and each next item configures a documents' getting. Each getting's item in DocForDoc configures how the documents represented by the config DocExt ( target documents ) will got from an other document ( source document ).
To a getting item DocForDoc can address from Doc and DocUpDoc config items and few public functions of the library DocExtLib.
Item's Format
The defaults item of the config DocForDoc is the first item from all. The item defines defaults for the getting of target documents in a DocForDoc item.
The format of the defaults item:
APP[ name ] VIEW[ name ] PICK[ name ] FOLDER[ name ]
The format description:
APP[ name ] - the name of an app ( in a project ) which the target documents will be got from. The projects and their apps are defined in the configs of the type Project.
VIEW[ name ] - the name of a view which the target documents will be got from.
PICK[ name ] - the name of a view which the target documents will be picked from by an user.
FOLDER[ name ] - the name of a folder ( not view ) which the target documents will be picked from by an user. The folder will be used instead of the view ( tag PICK ) either to pick documents by more than one key or when a condition is checked on target documents using tags TRG or BOTH.
The items of documents' getting should be placed under defaults item ( the first ) in a config DocForDoc. Type each new config item on new line.
The format of an item of documents' getting:
name [ description ] SRC{ condition } KEY{ formula } TRG{ condition } BOTH{ condition } APP[ name ] PRJ[ name ] VIEW[ name ] PICK[ name ] FOLDER[ name ] CAT{ formula }
The format description:
name - unique name of the item in the config ( without spaces ). It's recommended to use a short name and begin it from text corresponding to the source documents, for example - their form's name. The full name of a config item through which you can address to the item will be the combine of names of the config and of its item through the letter "4". Thus the full name of an item will contain info about both the target documents and a source document. For example, if the config DocExt is named "Contract" ( target documents ) and an item DocForDoc is named "Company" ( source document ) the full name of the config item will "Contract4Company". To address to a config item DocForDoc from somewhere, you must always use its full name.
[ description ] - a text of description for the item. For example - [ Contracts for the Company ].
SRC{ condition } - defines when to perform the documents' getting. The condition is checked on a source document.
KEY{ formula } - computes the key to get or pick the target documents in the view. The result must be a text. The formula is computed on a source document.
TRG{ condition } - defines when a target document remains in the got ones list. The condition is checked on each target document that was got from view ( tag VIEW ) by key ( tag KEY ).
BOTH{ condition } - defines when a target document remains in got ones list. The condition is checked on each target document that has been got from view ( tag VIEW ) by key ( tag KEY ) and next checked by condition ( tag TRG ) and on source document at the same time. Inside the formula type the tags SRC[ name ] and TRG[ name ] to use value of the field with specified name in source and target document accordingly. A result got by the tag SRC or TRG will always be a text enclosed in quotes. If a tag result will be a list each its element will be enclosed in quotes with separating the all elements by colon between themselves to transform the list in the format of Formula Language.
VIEW[ name ] or VIEW{ formula } - the name of a view or formula to compute it. Overwrites the name specified in the tag VIEW of the config's item with defaults.
PICK[ name ] or PICK{ formula } - the name of a view or formula to compute it. Overwrites the name specified in the tag PICK of the config's item with defaults.
FOLDER[ name ] or FOLDER{ formula } - the name of a folder or formula to compute it. Overwrites the name specified in the tag FOLDER of the config's item with defaults.
CAT{ formula } - computes single category to display documents in the folder. The tag matters only for the documents picking by a user in the folder got by the tag FOLDER when the result of the tag KEY is list.
APP[ name ] or APP{ formula } - the name of an app, or a formula to compute it. Overwrites the name specified in the tag APP of the config's item with defaults. The projects and their apps are defined in the configs of the type Project.
PRJ[ name ] or PRJ{ formula } - the name of an project with the app defined by the tag APP, or formula to compute it. Use the tag only if the target documents' project differs from source document's project. The projects and their apps are defined in the configs of the type Project.
In the tags VIEW, PICK, FOLDER, APP, PRJ with the brackets { } a formula will be computed on a source document. By all the tags as well as the tag KEY you can compute a list as result but in this case the bounds of the lists either must be equal between themselves or must be equal to one.
Topic links:
See also: