<< Click to Display Table of Contents >> Navigation: Windows > User Interface > Scripting |
Fragen und Antworten zum Thema OMNITRACKER Windows User Interface ↦ Scripting:
Das Verhalten hängt hier davon ab, ob das Control an eine Aktion oder an ein Feld geknüpft ist oder nicht.
Wenn das Control an ein OMNITRACKER Feld geknüpft ist, so lässt es sich nicht durch Script-Zeilen vor Eingaben sperren/entsperren, da die
Kontrolle über die Permissions des jeweiligen Users systemseitig erfolgt. So gelten in diesem Fall die Permissions, die für den jeweiligen
User in der Folder Definition festgelegt wurden.
Wenn das Control NICHT an ein OMNITRACKER Feld geknüpft ist, so muss das "Enabled" Flag in den Control Properties im Form-Editor gesetzt sein. Die Code-Zeilen:
<ctrl>.Enabled = False
sowie <ctrl>.Enabled = True
können dann wie erwartet eingesetzt werden.
Im Falle eines Edit Controls kann man auch das Property "Locked" nutzen. Weiterführende Informationen finden Sie in der OMNITRACKER Form Editor Help.
Code zum Erreichen der Download-All-Funktionalität (Onclick-Code) auf einem Download-All-Icon:
If Not ActiveRequest.Fields("Attachments").IsNull Then
myStartFolder = ""
Set objAllAttachments = ActiveRequest.Fields("Attachments").TValue
Set WshShell = CreateObject("WScript.Shell")
myStartFolder = WshShell.ExpandEnvironmentStrings("TEMP")
SelectFolder = vbNull
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(0, "Select Folder", 0, myStartFolder)
If IsObject(objFolder) Then SelectFolder = objFolder.Self.Path
strPath = CStr(objFolder.Self.Path)
Set objFolder = Nothing
Set objShell = Nothing
If myStartFolder <> "" Then
For Each objAllAttachment In objAllAttachments
strAttachmentName = objAllAttachment.Name
strFileStore = strPath & "\" & strAttachmentName
objAllAttachment.WriteToFile(strFileStore)
Next
MsgBox "All Attachments are stored on the following location: " & strPath, vbInformation
End If
Else
MsgBox "There are no Attachments present to save", vbCritical
End If