Skip to content

Instantly share code, notes, and snippets.

@lonelydimple
Created March 23, 2012 02:21
Show Gist options
  • Save lonelydimple/2166251 to your computer and use it in GitHub Desktop.
Save lonelydimple/2166251 to your computer and use it in GitHub Desktop.
Function strreplace(Byval src As String, Byval dest As String, Byval arg As String) As String
Dim pos As Integer
pos = Instr(arg, src)
While (pos > 0)
arg = Left(arg, pos - 1)+ dest + Mid(arg, pos + Len(src))
pos = Instr(pos + Len(dest), arg, src)
Wend
strreplace = arg
End Function
Sub Initialize
Dim doc As NotesDocument
Dim session As New NotesSession
Dim db As NotesDatabase
Dim principal_doc As NotesDocument
Set doc = session.DocumentContext
Set db = session.CurrentDatabase
principal_id = Evaluate(|@Middle("| + doc.Query_String(0) + |";"idprin=";"&")|)
Set principal_doc = db.GetDocumentByUNID(principal_id(0))
Call principal_doc.ReplaceItemValue("fromBondOrder", "")
Call principal_doc.ReplaceItemValue("formUNID", "")
Call principal_doc.save(False, False)
new_query_string = strreplace("OpenAgent", "OpenForm", doc.Query_String(0))
Print ("[/bondsn.nsf/CommBondRatings?" + new_query_string + "]")
End Sub
location.href = "/principal.nsf/ContinueOrder?OpenAgent&form_identifier=" + document.forms[0].formUNID.value +
"&id=" + document.forms[0].Agency.value +"&idprin=" + document.forms[0].principalUNID.value +
"&State=" + document.forms[0].obligation_state.value + "&";
@ryanhanks
Copy link

Where are the accompanying unit tests? ;)

@lonelydimple
Copy link
Author

it "should not explode" do
  DOMINO.should be_alive
end

@ryanhanks
Copy link

ryanhanks commented Mar 23, 2012 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment