Child pages
  • DT_Customized_Export_phase _02


DT_Customized_Export_phase _02

Requirement Features:

Product Line:

Microsiga Protheus®:

Industry:

Legal

Module:

SIGAJURI

Routine:

Routine

Technical Name

JURA108

Customized Export

Routine(s) involved

Technical Name

JURA023

Customized export fields

JURXFUN

Generic function SIGAJURI /SIGAPFS

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

  1. In the module Legal Management (SIGAJURI), access Updates / Configuration / Customized Export (JURA108);
  2. Select table, click  Edit;
  3. Click table  and lower grid (Formulas);
  4. Register formula filling out the  description, name of function created and Parameters needed for function.
    Example:
                          Description: Concatenated Involved
                          Function: FEXP_ENVC
                          Parameters: NUQ_CAJURI,1
  5. After registering formulas, click Confirm;
  6. Access Updates / Legal Subjects / Search  and select the search, fill out the filters, click Search.
  7. Click the mouse right button in the process, view message, then click  Add process in printing queue;
  8. Right click the message, then Customized export;
  9. View the window with the question: The values correction routine has already been run?, if positive, click Yes;
  10. Select table(s) the formulas were registered.
  11. Add fields and/or formulas.
  12. Click Export.
  13. Select folder the file is generated, then define the file name.
  14. Click Save;
  15. A window is displayed indicating where the file was generated and the following question: Open file? 
  16. If positive, click Yes.
  17. File in Excel format is opened.