Árvore de páginas

2.1. Objective

Allow the user to upload/download a document to the FLUIG(GED) document center, linking it to a record in business database. This functionality can be used in metadata forms of the type CRUDFreeForm or FreeForm.

 

2.2. Use Guide

When a form includes a record selected by the user, its Related Actions component can present an item to allow the association of any document with the selected record. Figure 1.2.a presents a Metadata CRUD with a selected record. When the user clicks Related Actions, the Document Association item will be presented.

Figure 1.2.a

In the case of CRUDFreeForm, when the user selects a record (only 1) in the search grid, the document association item should be automatically available. In the case of FreeForm, the ABLScript code shall be used to enable the item.  

When the user clicks the Document Association item, the window presented in Figure 1.2.b will be displayed.

Figure 1.2.b

After confirming the operation, the window of Figure 1.2.c will be presented to the user, where the user can click the Select button to choose a file in the local machine.

Figure 1.2.c

 

The system will then load the file and send it to a folder in GED. Then it displays the screen shown in Figure 1.2.d.

Figure 1.2.d

After adding a document, the user has the option to add other files to associate with the same record, as shown in Figure 1.2.e.

Figure 1.2.e

In another situation, the user may select the same record again, open Related Actions and click again in Document Association (Figure 1.2.a). From this point, the user can download one of the files associated back to the local machine or remove the document association with the record, as shown in figures 1.2.f and 1.2.g.

Figure 1.2.f

Figure 1.2.g

 

2.3. Programming Guide

In order for the component of Related Actions of a CRUDFreeForm to be able to present the Document Association item, the enableDocRel property must be set via the ABLScript, as shown in the following example:

SETPROPERTY(relatedActions, “enableDocRel”, true).


In case of FreeForm forms, the developer should add the RelatedActionsOperation component to the form. When there is a selected record in the form, run a script similar to the following:

DEFINE VARIABLE relatedActions AS WIDGET-HANDLE.
DEFINE VARIABLE data AS CHARACTER.
DEFINE TEMP-TABLE ttFullRecId
   FIELD databaseName AS CHARACTER
   FIELD tableName AS CHARACTER
   FIELD recordKeys AS CHARACTER.
DEFINE TEMP-TABLE ttRecId
   FIELD cdn_cliente AS INTEGER
   FIELD cod_empresa AS CHARACTER.
CREATE ttRecId.
ttRecId.cdn_cliente = 3455.
ttRecId.cod_empresa = "1".
data = JSON-ENCODE(ttRecId, true).
CREATE ttFullRecId.
ttFullRecId.databaseName = "emsuni".
ttFullRecId.tableName = "cliente".
ttFullRecId.recordKeys = data.
data = JSON-ENCODE(ttFullRecId, true).
SETPROPERTY(relatedActions, "enableDocRel", true).
CALLFUNCTION(relatedActions, "setDocRecordId", data).

 

Information about associations between record and documents is stored in a table named docto_ged_relac_rec in the EMSFND database.

 


  • Sem rótulos