Manage Learn to apply best practices and optimize your operations.

Add or Remove Prohibit design refresh

Add or Remove Prohibit design refresh or replace to modify from a View or Folder

This function will modify the design flag "Prohibit design refresh or replace to modify" on a view or folder through LS. This comes in handy when you are using NotesDocument.PutinFolder([FOLDERNAME],1). You don't want the design task to remove the folder because it does not exist in the template. This script does it through the UI; however, with slight modifications you can put it in an agent or library. With a little ingenuity, you can also do the same with any other design documents in a database.

 Sub Initialize Dim ws As New notesUIWorkspace Dim session As New notessession 'Database declaration Dim db As notesdatabase 'View variables Dim view As notesview Dim views As Variant Dim viewCount As Double Dim str_view_Name As String 'Doc variables Dim doc As notesdocument 'Temp Variables Dim retVal As Variant Dim t_String As Variant 'Get various handles Set db = session.currentDatabase views = db.Views 'Get all the view/Folder names in the database viewCount = 0 Forall v In views If(v.Name <> "")Then Redim Preserve viewNames(0 To viewCount) viewNames(viewCount) = v.Name viewcount = viewCount + 1 End If End Forall 'If there are no views then raise an error If viewCount = 0 Then Error 1000,"No views found in " & db.Title & "!" 'Display the databases to the user for selection in a listbox retVal = ws.Prompt(PROMPT_OKCANCELLIST, "Select View/Folder", |Select the view or folder to change the "Prohibit design refresh or replace to modify" flag.|,viewNames(0), viewNames) 'If no view is selected then exit If retVal = "" Then Exit Sub 'Get a handle on the view Set view = db.GetView(retVal) 'get the UNID t_String = view.UniversalID Set view = Nothing 'Get the view as a document Set doc = db.Getdocumentbyunid(t_String) 'The field $Flags holds information on the folder. '"Prohibit design refresh or replace to modify" is represented by "P". 'If the "P" is not there, add it and the checkbox will be on when viewed in Domino Designer. Dim temp_msg As String If Instr(1,doc.GetItemValue("$Flags")(0),"P") Then temp_msg = |The folder | & retVal & | is set to "Prohibit design refresh or replace to modify".| & Chr(10) & |Would you like to remove this?| If Msgbox(temp_msg,36,"Question") = 6 Then 'Remove the flag and save the folder Call doc.ReplaceItemValue("$Flags",Left(doc.GetItemValue("$Flags")(0),Instr(1,doc.GetItemValue("$Flags")(0),"P") - 1) & Mid(doc.GetItemValue("$Flags")(0), Instr(1,doc.GetItemValue("$Flags")(0),"P") + 1)) Call,0) End If Else temp_msg = |The folder | & retVal & | is not set to "Prohibit design refresh or replace to modify".| & Chr(10) & |Would you like to add this?| If Msgbox(temp_msg,36,"Question") = 6 Then 'Add the flag and save the folder Call doc.ReplaceItemValue("$Flags", doc.GetItemValue("$Flags")(0) & "P") Call,0) End If End If 'Clear all the handles Set doc = Nothing Set db = Nothing Set ws = Nothing Set session = Nothing End Sub

Dig Deeper on Domino Resources - Part 2

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.



  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...