mardi 13 mars 2007

How to default the Reports and Pick a Search to All vs. My

In 5.9 when choosing Pick a Search or Reports from an object on the eTab, the default is set to "My Reports" or "My Searches". How can i change those default to go straight to All Reports or All Searches?

The following code fires on open of any modal window. It detects if the window relates to Pick a Searches, and if so takes the appropriate action to change the tab.

This code can be amended by altering the if statement detecting the pick a search condition to just reports, or it can also be amended to include both.

Possible alternate if statements to check for reports, or either condition:

'If InStr(1, objTDElement.Title, "Report") > 0 Then
'If (InStr(1, objTDElement.Title, "Report") + If InStr(1, objTDElement.Title, "Pick a Search")) > 0 Then

Sub OnModalWindowOpen()
Dim objTDElements
Dim objCenter
Dim objTop
Dim blnUpdate
blnUpdate = False

' Look at the top element to see if its is a Pick-a-Search
Set objTop = UIMaster.documenttop
Set objTDElements = objTop.getelementsbytagname("SPAN")

For Each objTDElement In objTDElements
'Modify this if statement to include reports if required
If InStr(1, objTDElement.Title, "Pick a Search") > 0 Then
blnUpdate = True
End If
Next
' If the window is a pick a search then process the rest of the changes
If blnUpdate Then
Set objCenter = UIMaster.documentCenter
Set objTDElements = objCenter.getelementsbytagname("DIV")
For Each objTDElement In objTDElements
If objTDElement.classname = "Tab_0" Then
objTDElement.classname = "UITab"
End If
If objTDElement.id = "Tab_1" Then
objTDElement.classname = "UITabSelected"
objTDElement.Focus()
objTDElement.Click()
End If
Next
End If
End Sub

Aucun commentaire: