Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to delete objects in a user's inbox in BO 4.0

Is there an equivalent SAP note to "1367065 - How to delete objects in a user's inbox in BOXI 3.1?" for BO 4.0?

Is there an alternative process to automatically delete old reports in each users BI Inbox that doesn't require the use of the SDK?

Regards,

Jose Luis Leitao

Tags:
replied

Jose,

This should help you.

http://www.forumtopics.com/busobj/viewtopic.php?t=162714&postdays=0&postorder=desc&start=15

For deployment Instruction, follow the steps as specified in the above URL.

This is Developed in COM SDK (VB Script) and has to be deployed as a program object.

This is the actual code


' ************************************************************************

' Deletes old Inbox records for any user with more than 999 items in

' their inbox.  Each time this is run, it will delete up to 100 documents.

' ************************************************************************


Dim APS

Dim UserID

Dim Password

Dim Aut

Dim oSessionManager

Dim oEnterpriseSession

Dim oSess

Dim OldSIName


OldSIName = " "


'For the logon, Authenticate as Following

APS = Wscript.Arguments(0)

UserID=Wscript.Arguments(1)

Password = Wscript.Arguments(2)

Aut = Wscript.Arguments(3)


'Create an Enterprise oSessionManager

Set oSessionManager = WScript.CreateObject("CrystalEnterprise.SessionMgr")

Set oSess = oSessionManager.Logon(UserID, Password, APS, Aut)



'Query the iStore and get up to 100 inbox items to delete

On Error Resume Next

'Create a new Variable for the login token

Set iStore = oSess.Service("", "InfoStore")


queryString = "select TOP 100 * from CI_INFOOBJECTS Where CHILDREN(""SI_NAME='Folder Hierarchy'"",""SI_KIND='Inbox' and SI_CHILDREN>999"") and SI_UPDATE_TS < '"

queryString = queryString & Year(DateAdd("d", -100, Date)) & "."

queryString = queryString & Right("00" & Month(DateAdd("d", -100, Date)), 2) & "."

queryString = queryString & Right("00" & Day(DateAdd("d", -100, Date)), 2)

queryString = queryString & "' order by SI_UPDATE_TS"


Set objFSO = CreateObject("scripting.filesystemobject")

Set logStream = objFSO.OpenTextFile("c:\inboxdeletelog.txt", 8, 1)

logStream.writeline "Server - DateTime: " & APS & " - " & FormatDateTime(Now,0)

logStream.writeline "Query: " & queryString


Set inboxRecords = iStore.Query(queryString)


for x = 1 to inboxRecords.Count

    Set inboxRecord = inboxRecords.Item(x)

    If inboxRecord.Properties.Item("SI_NAME").Value <> OldSIName Then

        logStream.writeline "SI_OWNER-SI_KIND-SI_UPDATE_TS-SI_NAME-SIZE: " & inboxRecord.Properties.Item("SI_OWNER").Value & _

        " - " & inboxRecord.Properties.Item("SI_KIND").Value & _

        " - " & inboxRecord.Properties.Item("SI_UPDATE_TS").Value & _

        " - " & inboxRecord.Properties.Item("SI_NAME").Value & _

        " - " & inboxRecord.Properties.Item("SI_FILES").Properties.Item("SI_VALUE1").Value

        inboxRecords.Delete(inboxRecord)

    End If

    OldSIName = inboxRecord.Properties.Item("SI_NAME").Value

Next

IStore.Commit(inboxRecords)


oSessionManager.logoff

logStream.Close

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question