DT_Customized_Export_phase _02
Requirement Features:
Product Line: | Microsiga Protheus®: | ||||||||||
Industry: | Legal | ||||||||||
Module: | SIGAJURI | ||||||||||
Routine: |
| ||||||||||
Initial Registration: | Register of formulas (JURA108) | ||||||||||
Request (ISSUE): | PCREQ-5814 | ||||||||||
Country(ies) | All | ||||||||||
Database: | All | ||||||||||
Tables: | NZJ | ||||||||||
Operational system(s): | WINDOWS | ||||||||||
Versions/Release: | 12.1:7 |
Description
It enables uses to add formulas as field options to Customized Export.
The option to develop functions () receiving parameters previously registered in formulas register (Configuration/Customized export JURA023).
Display the functions in fields list of Customized Export. And, when selected, the return of functions is displayed in the file generated in Customized Export.
How formula must be registered?
As a Function or User Function in the RPO of Protheus. Remember its name cannot exceed 09 characters.
Added to formulas register (Configuration / Customized Export JURA023)
Formulas Register | ||
Description | Function | Parameters |
Concatenated Involved | FEXP_ENVC | NUQ_CAJURI, ‘1’ |
Description: Name of field displayed in the spreadsheet and in the list of Customized Export fields.
Formula: Name of Function or User Function;
Parameters: List of parameters separated by comma. For fields, enter name without inverted commas. For text, add information by using inverted commas.
How Function must be written
Function receives parameters according to formulas register.
Example:
USER FUNCTION FEXP_ENVC (cCajuri, cTipo)
Local cRet := ‘’
Local aArea := GetArea()
Local cLista := GetNextAlias()
Local cSQL
cSQL := “SELECT NT9.NT9_NOME FROM “ + RetSQLName(“NT9”) + “ NT9 ”
cSQL += “ WHERE NT9.NT9_CAJURI = ‘” + cCajuri + “’”
cSQL += “ AND NT9.NT9_FILIAL = ‘” + xFilial(‘NT9’) + “’”
cSQL += “ AND NT9.D_E_L_E_T_ = ‘ ‘”
cSQL := ChangeQuery(cSQL)
dbUseArea(.T., 'TOPCONN', TcGenQry( ,, cSQL ) , cLista, .T., .F.)
dbSelectArea(cLista)
(cLista)->(dbGoTop())
While (cLista)->(!Eof())
cRet += (cLista)->NT9_NOME
if ((cLista)->(!Eof())
cRet += “/”
Endif
(cLista)->(dbSkip())
End
(cLista)->( dbcloseArea() )
RestArea( aArea )
Return cRet
Procedures for Use