# Enterprise Communication Interface (ECI)

## eci_rea_rel_ent

| ### Description
| ECI function to read refine, aggregate or constraint relation records and corresponding entity entries for relation entries.
| It can be better to add (missing) entity field in relation widget during customizing and read record with eci_rea_rel (much better performance!). If no return fields for relation are mentioned, there will be a null-string in return parameter for each relation record!
| Example: eci_rea_rel_ent (char *cpConnection, eci_param * tpFunPar), ECI-Inputparameter consists of:
| ### Input parameter
| cpEntNam
string | name of entity of father
cpMasNam
string | {on|off} off: no list extension on: add systemfields to list (wdh_ext_lis) - only available for lists.
cpWdgMod
string | {list|form|bvb} widget mode of father widget.
cpActMod
string | {bat} action mode
cpaEntFld
stringlist | names of fields to select father
cpaEntVal
stringlist | values of fields to select father
cpEnt2Nam
string | name of entity of son
cpViewNam
string | name of relation (view) or constraint
cpRefAgg
string | {ref|agg|cns} refine, aggregate or constraint list.
cpRelMasNam
string | name of list of relation
cpRelMasExt
string | {on|off} off: no relation list extension. on: add system fields to relation list (wdh_ext_lis) - only available for lists
cpRelWdgMod
string | {list|form|bvb}idget mode of relation widget
cpaRelFld
stringlist | names of fields of relation to select
cpaRelVal
stringlist | values of fields of relation to select
cpaRetRelFld
stringlist | names of fields of relation to return
cpMasLimit
string | {on|off}. off: mask limit is set to found records. on: defined mask limit is used.
cpRelEntMasNam
string | name of list of entity for relation
cpRelEntMasExt
string | {on|off}. off: no relation list extension. on: add systemfields to relation list (wdh_ext_lis) - only available for lists
cpRelEntWdgMod
string | {list|form|bvb} widget mode of entity widget for relation
cpaRetEntFld
stringlist | names of fields of relation to return
cpPerformFlag
string | {off|on}: if you have no cpRetRelFld, then you can set this flag to "on" and the cpRetEntFld of all records will be read with one database access (as the sequence of the records has no meaning in this case
cpRelEntWdgMod
string | {list|form|bvb} widget mode of entity widget for relation.
cpaRetEntFld
stringlist | names of fields of relation to return
cpPerformFlag
string | {off|on}: if you have no cpRetRelFld, then you can set this flag to "on" and the cpRetEntFld of all records will be read with one database access (as the sequence of the records has no meaning in this case
| ### Output parameter
iNum | string | number of records found
cpaRetRelVal_1 | stringlist | return values for relation of record 1
... |  |
cpaRetRelVal_n | stringlist | return values for relation of last record
cpaRetEntVal_1 | stringlist | return values for entity of record 1
... |  |
cpaRetEntVal_n | stringlist | return values for entity of last record
####
| ### Example
| To read file name (not in relation widget) and paper format for relation at position 20 in document-file-relation for document "drw4711" from entity widget:
| eci_add_par(&tpFunPar, "EDB-DOCUMENT"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "EDB-DOC-SLI"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "off"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "list"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "bat"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "T_DOC_DAT.DOCUMENT_ID"); eci_add_par(&tpFunPar, "T_DOC_DAT.DOC_TYPE"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "drw4711"); eci_add_par(&tpFunPar, "DRAWING"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "EDB-FILE"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "STR"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "ref"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "EDB-DOC-FIL-RLI-C"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "off"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "list"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "T_DOC_FIL.POS_NO"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "20"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "T_FILE_DAT.ORG_NAME"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "off"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "EDB-FIL-SLI"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "off"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "list"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "T_FILE_DAT.PAPER_FORMAT"); eci_end_par(&tpFunPar); eci_add_par(&tpFunPar, "off"); eci_end_par(&tpFunPar);