Skip to main content

LookupPrintCompany

Structure

LookupPrintCompany

Parameters

none

Return value

String

Description

Important: this function is only usable during the 'After Document Creation' trigger action as setup in event script. This function returns the Company that owns the asset currently selected in the event and applicable to this print job.

Example

sMostRecentEvent = IntToStr(LookupPrintEventNum)
if sMostRecentEvent <> "" then
sCompany = LookupPrintCompany
sCertName = ReturnFromSQL("SELECT CERT_FILE_NAME FROM CERTS WHERE EVENT_NUM = " & sMostRecentEvent)
sDocName = ReturnFromSQL("SELECT FILE_NAME FROM EVENTDOCS WHERE EVENT_NUM = " & sMostRecentEvent)
sFile1 = GetIndySoftTempDir & sCertName
sFile2 = GetIndySoftTempDir & sDocName
sFileName1= ReturnBlobTofile("SELECT CERT_RTF FROM CERTS WHERE EVENT_NUM = " & sMostRecentEvent, sFile1)
sFileName2= ReturnBlobToFile("SELECT DOC_BLOB FROM EVENTDOCS WHERE EVENT_NUM = " & sMostRecentEvent, sFile2)
sCertName = Left(sCertName, Len(sCertName) - 4)
sDocName = Left(sDocName, Len(sDocName) - 4)
sNewFileName = GetIndySoftTempDir & sCertName & sDocName & ".pdf"
AppendPDFFilesRepaginate(sFile1, sFile2, sNewFileName, "Page [Page] of [Total]")
sFile3 = sNewFileName
' sWhere = "WHERE EVENT_NUM = " & sMostRecentEvent & " AND COMPANY = '" & sCompany & "'"
sWhere = "WHERE EVENT_NUM = " & sMostRecentEvent
UpdateBlobWithFile("CERTS", "CERT_RTF", sWhere, sFile3)
end if

See also

No related topics