Hi Rdd1963.
When you set a grid field as a hyperlink, you need use the "Link click delegate" on the section.
In this case, I've a column "File" whith the "Hyperlink" set to "true".
My code is:
Code:
////////////////////////////////////////////////////////////////
// Event delegate for 'linkclick' event
proc Documenti_linkclick(hyperlinktext, _text)
? "Documenti_linkclick"
? "1 " + hyperlinktext
? "2 " + _text
Q_selectTable("progetti")
locate for progetti.id = documenti.progettoid
// MessageBox("You clicked '" + hyperlinktext + "' with text " + _text + "'")
// insert your code here
m_default = default()
? "comando " + hyperlinktext + " " + _text
if hyperlinktext == "m_load_documenti_file"
create_link_file()
endif
if hyperlinktext == "m_edit_caso"
select documenti
? "documenti.id = " + etos(documenti.id)
m_filtro = "page:documento.Documento_documento?action=search&" + "text=" + etos(documenti.id)
? "m_filtro" + m_filtro
Documento_changed()
// apre nella stess app
// Lianja.showDocument(m_filtro)
// apre la nuova app
lianja.spawnapp("SFM_Documento","","", "page:documento?action=search&text=" + etos(documenti.id))
// Lianja.showDocument("page:documento.Documento_documento?action=show")
// Lianja.showDocument("page:documento?action=show")
endif
if hyperlinktext == "m_load_allegati_file"
select allegati
if empty(allegati.file)
nReturn = 6
else
nReturn = messagebox("Sei sicuro?", 36, "Attenzione, c'è già un file assegnato")
endif
if nReturn = 6
m_recno = recno()
oGrid = Lianja.Get("documento.documento_allegati").grid
m_newDefault = mline(progetti.path, 1)
if !empty(m_newDefault)
set default to &m_newDefault
endif
m_file = getfile()
if !empty(m_file)
select allegati
goto m_recno
replace allegati.file with m_file
if m_recno > 1
oGrid.refreshRecord( m_recno )
endif
endif
else
// user selected 'No', process accordingly
endif
endif
set default to &m_default
if hyperlinktext = "m_open_documenti_file"
? "Apertura file " + mline(documenti.file, 1)
showdocument("file:///" + mline(documenti.file, 1))
endif
if hyperlinktext = "m_open_allegati_file"
? "Apertura file " + mline(allegati.file, 1)
showdocument("file:///" + mline(allegati.file, 1))
endif
if hyperlinktext = "CASO"
select documenti
m_filtro = "page:documento.documento_documento?action=search&text=" + etos(documenti.id)
? m_filtro
Lianja.showDocument(m_filtro)
Lianja.showDocument("page:documento.documento_documento?action=show")
endif
endproc
Bookmarks