When applying the settings shown in item 2. Settings, automatically for the metadata programs, it will be possible to associate documents to Logix records (provided the form has a search operation). The procedures to associate a document are shown below:
- Perform a search in the form being executed and press the
button Associate Document
- The following window will open, allowing you to add new
documents, or to delete, view and download documents previously
associated with the record
- When choosing to add a new document, a window will open where
you can choose the document to be uploaded to GED
- When choosing to associate a previously associated document,
a zoom will open with the files already associated with the table in
question
- When confirming the file association screen, all selected files will be sent to the Fluig GED tool.
Associating documents in Freeform programs
In Freeform programs, you need to add the Associate Documents operation manually, according to the code below:
Create the LDocAssociationButton on the tool bar, and add a 4GL event for this button
LET m_opcao_doc_assoc = _ADVPL_create_component(NULL,"LDOCASSOCIATIONBUTTON",m_menubar_reference) CALL _ADVPL_set_property(m_opcao_doc_assoc,"EVENT","log5500_document_association")
.
In the event of the button, which is executed by clicking on the associating document operation, the table and the primary key of the record that will be associated with the document should be informed to the association screen, also check if the search was performed by the user before taking any action
#-------------------------------------# FUNCTION log5500_document_association() #-------------------------------------# DEFINE l_doc_assoc_reference VARCHAR(10)
IF NOT m_consulta_ativa THEN CALL _ADVPL_set_property(m_statusbar,'ERROR_TEXT','Efetue primeiramente a consulta.') RETURN FALSE END IF
LET l_doc_assoc_reference = _ADVPL_get_property(m_opcao_doc_assoc,'DOC_ASSOCIATION_REFERENCE') CALL _ADVPL_set_property(l_doc_assoc_reference,'TABLE_NAME','log_usu_niv_sist') CALL _ADVPL_set_property(l_doc_assoc_reference,'ADD_RECORD','usuario',mr_usuario.cod_usuario) CALL _ADVPL_set_property(l_doc_assoc_reference,'ADD_RECORD','empresa',mr_usuario.cod_empresa)
RETURN TRUE END FUNCTION