Use the Documents tab to specify the basic settings to be used for document management. Document management allows you to link documents, such as drawings and offers, to customers, suppliers, sales orders, production files, etcetera, to ensure they are available at the required locations.
Document management system present
If the Document management system present check box is selected, the program assumes an external document management system (DMS) is present. If you are using a document management system (DMS) that is linked to Isah, document management takes place in that DMS. This means you use the document management system to change or delete document data. In Isah, you link the documents, and execute processes with scripts from the Edit menu, such as opening the document in Isah.
If the check box is selected, you can no longer add, change or delete any documents on the Documents form.
Automatic document registration on document link entry
To enable quick document registration, select the Automatic document registration on document link entry check box. If you are using the Quick Document Registration feature, documents are registered automatically when you link them.
This check box will be empty if you are using a document management system, or if you want to register documents centrally before you link them to records. If you are managing documents centrally, you register a document once on the Documents form, and then simply link the document to all records the document is related to.
Delete document registration on deletion of last document link
The Delete document registration on deletion of last document link check box makes it easier for you to delete documents from Isah. If this check box is selected, and you delete the last link to a document, the document registration will automatically be undone as well. If this check box is not selected, deletion is a two-step process: first delete the link, and then delete the document.
If you register documents centrally, it is possible to grant users rights to link and unlink documents, but not to manage documents. In that case, the check box must be empty, otherwise users will also delete the document when they delete the last link.
If the check box is selected, both the last link and the document itself will be deleted if the following conditions are true:
Any document rights assigned to the document do not affect the deletion of the document. The registration, including the rights, will be deleted.
Specify the main folder in which the files created by the Send documents process or the Outlook Add-In are to be saved in.
If you select this check box, a separate subfolder is created for the different entities when you save documents using the Send documents option or the Outlook Add-In. Entities are the Isah data documents can be linked to, such as customers, purchase invoices, parts, or employees. This means that the parent folder will have a new subfolder called, for instance, 'Customers' or 'Parts', in which the documents with that entity type are saved.
When documents are saved, for example by the Send documents process or the Outlook Add-In, a path and file name are created automatically, provided they have been set. You can use a script to specify alternative file names or document formats, as illustrated by the sample script below. You may want to do so to present invoices in different languages and then save them in separate folders.
The script you specify here is created on the Scripts form.
Sample script
function BeforeProcessFileName(sOutputFileName, iEntityType, vId, sLangCode, sDocumentType)
rem The default OutputFileName has the following pattern:
rem <Base folder from settings>\<subfolder from document type>\<id>\<Filename>
rem Example: C:\IsahDocuments\Emails\AR014\Customer_AR014_20160901_09-45.msg
rem With this script we will create two extra subfolders, based on the description of the entity type
rem and the language. The original path+filename will only be used for the filename part
rem In case you need to know who called this script, check the value of
rem global property ScriptContext.ScriptContextType which can be sctExternalDocuments or sctOutlookAddIn
dim sBaseFolder, sDocumentTypeFolder, sEntityFolder, sLanguageFolder, sIdFolder, sTrailingFileName
sBaseFolder = GetSQLValue("SELECT DocRootFolder FROM dbo.T_Setting WHERE SettingCode = 1")
sDocumentTypeFolder = GetSQLValue("SELECT SubFolder FROM dbo.T_DocumentType WHERE DocumentTypeCode = N'" & sDocumentType & "'")
sLanguageFolder = GetLanguageFolderName(sLangCode)
sEntityFolder = GetEntityDescription(iEntityType, sLangCode)
sIdFolder = GetIdFolder(iEntityType, vId)
sTrailingFileName = GetFileName(sOutputFileName)
if (TrailingFileName = "") then
TrailingFileName = "Document.txt"
end if
BeforeProcessFileName = AddPathDelimiter(sBaseFolder) & _
AddPathDelimiter(sDocumentTypeFolder) & _
AddPathDelimiter(SanitizeFolderName(sEntityFolder)) & _
AddPathDelimiter(SanitizeFolderName(sLanguageFolder)) & _
AddPathDelimiter(SanitizeFolderName(sIdFolder)) & _
SanitizeFolderName(sTrailingFileName)
end function
function GetSQLValue(sSQL)
rem Get first value from SQL query
dim oQry
set oQry = IsahObjects.Get("TIsahCDSQuery")
oQry.DatabaseName = "dbisahadmin"
oQry.SQL.Text = sSQL
oQry.Open
GetSQLValue = oQry.Field(0).Value
oQry.Close
set oQry = nothing
end function
function GetFileName(sFileName)
rem Strip path from file name
set oFso = CreateObject("Scripting.FileSystemObject")
GetFileName = oFso.GetFileName(sFileName)
set oFso = nothing
end function
function AddPathDelimiter(sPath)
rem Make sure path ends with backslash
AddPathDelimiter = Trim(sPath)
if AddPathDelimiter <> "" and (Right(AddPathDelimiter, 1) <> "\") then
AddPathDelimiter = AddPathDelimiter & "\"
end if
end function
function SanitizeFolderName(sFileName)
rem Replace invalid characters
const sInvalidChars = "/:*?<>|"""
dim i
SanitizeFolderName = Trim(sFileName)
for i = 1 to Len(sInvalidChars)
SanitizeFolderName = Replace(SanitizeFolderName, Mid(sInvalidChars, i, 1), "_")
Next
end function
function GetLanguageFolderName(sLangCode)
rem Translate language code into description
iLangId = GetSQLValue("SELECT LangID FROM T_Language WHERE LangCode = N'" & sLangCode & "'")
select case iLangId
case 1
GetLanguageFolderName ="Nederlands"
case 2
GetLanguageFolderName ="Deutsch"
case 5
GetLanguageFolderName ="English"
case 11
GetLanguageFolderName ="Français"
case else
GetLanguageFolderName ="Miscellaneous"
end select
end function
function GetIdFolder(iEntityType, vId)
rem Translate technical key value to functional key value, where appropriate
dim arrKeys
select case iEntityType
case etSalesOffer
GetIdFolder = GetSQLValue("SELECT QuotNr FROM T_DossierMain WHERE DossierCode = '" & vId & "'")
case etSalesOrder
GetIdFolder = GetSQLValue("SELECT OrdNr FROM T_DossierMain WHERE DossierCode = '" & vId & "'")
case etSalesLine
arrKeys = Split(vId, "_")
arrKeys(0) = GetSQLValue("SELECT OrdNr FROM T_DossierMain WHERE DossierCode = '" & arrKeys(0) & "'")
GetIdFolder = Join(arrKeys, "_")
case etPurchaseOffer
GetIdFolder = GetSQLValue("SELECT PurQuotNr FROM T_PurchaseDocument WHERE PurDocCode = " & vId)
case etPurchaseOrder
GetIdFolder = GetSQLValue("SELECT PurOrdNr FROM T_PurchaseDocument WHERE PurDocCode = " & vId)
case else
GetIdFolder = CStr(vId)
end select
end function
function GetIsahTableDescription(iIsahTableId, sLangCode)
rem Get description of IsahTable
GetIsahTableDescription = GetSQLValue("SELECT T.Description FROM T_IsahTableML AS T INNER JOIN T_Language AS L ON (L.LangID = T.LangID) WHERE T.IsahTableId = " & iIsahTableId & " AND L.LangCode = N'" & sLangCode & "'")
if IsNull(GetIsahTableDescription) then
GetIsahTableDescription = GetSQLValue("SELECT T.Description FROM T_IsahTableML AS T INNER JOIN T_Language AS L ON (L.LangID = T.LangID) WHERE T.IsahTableId = " & iIsahTableId & " AND L.LangCode = N'" & Application.GetSetting("BasicLangCode") & "'")
end if
if IsNull(GetIsahTableDescription) then
GetIsahTableDescription = GetSQLValue("SELECT T.Description FROM T_IsahTableML AS T INNER JOIN T_Language AS L ON (L.LangID = T.LangID) WHERE T.IsahTableId = " & iIsahTableId & " AND L.LangCode = N'EN'")
end if
if IsNull(GetIsahTableDescription) then
GetIsahTableDescription = ""
end if
end function
function GetEntityDescription(iEntityType, sLangCode)
rem Get description of entity
dim iIsahTableId
select case iEntitytype
case etCustomer
iIsahTableId = 9
case etSupplier
iIsahTableId = 10
case etEmployee
iIsahTableId = 13
case etPart
iIsahTableId = 12
case etSalesOffer
iIsahTableId = 2
case etSalesOrder
iIsahTableId = 2
case etPurchaseOrder
iIsahTableId = 8
case etProject
iIsahTableId = 83
case etProductionOrder
iIsahTableId = 3
case etObject
iIsahTableId = 11
case etMessage
iIsahTableId = 15
case etSalesContract
iIsahTableId = 278
case etPurchaseOffer
iIsahTableId = 8
case etPurchaseContract
iIsahTableId = 332
case etServiceMessage
iIsahTableId = 454
case etServiceContract
iIsahTableId = 55
case etAction
iIsahTableId = 16
case etShippingNote
iIsahTableId = 58
case etProcessedShippingNote
iIsahTableId = 58
case etSalesInvoice
iIsahTableId = 59
case etPurchaseInvoice
iIsahTableId = 64
case etLotNumber
iIsahTableId = 299
case etCertificate
iIsahTableId = 290
case etCustomerContact
iIsahTableId = 172
case etSupplierContact
iIsahTableId = 160
case etPurchaseLinePart
iIsahTableId = 69
case etPurchaseLineEquipment
iIsahTableId = 65
case etPurchaseLineExtOperation
iIsahTableId = 66
case etSalesLine
iIsahTableId = 1
case etServiceContractVersion
iIsahTableId = 56
case etPurchaseReminder
rem There is no Purchase reminder table in Isah, so we link it to the Supplier
iIsahTableId = 10
case etShippingNoteExtOperation
iIsahTableId = 360
case else
iIsahTableId = 0
end select
if (iIsahTableId > 0) then
GetEntityDescription = GetIsahTableDescription(iIsahTableId, sLangCode)
else
GetEntityDescription = ""
end if
end function