Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Edit Profile
System
I have inherited an nrs that we used with a previous version of iManage infoRite, 5.3. The author no longer works with us so we lost the knowldge on how to further modify the script to comply with future versions - figures.
We used the nrs, called EditProf.nrs to catch user input when editing a document's profile. We are moving to Desksite 6.06 on XP and the nrs no longer works. I have debugged and DesSite does not seem to recognize the call to "EditProfileDlg_OnOK(dlg)" see code extract below...
msgbox("I am being called 1") <--- this is displayed so it tells me the nrs is recognized and processing starts
Sub EditProfileDlg_OnOK(dlg) <--- this is where is fails with no error
msgbox("I am being called 2")<--- my debug line to tell me if it entered the subroutine, never displays this message box
Dim objDoc, strCustom1, strCustom2, strcustom3, strcustom4, strcustom5, Strdb
Dim strcustom6, strNum, strnm, cline, strcustom7
Dim Individ
strNum = Dlg.GetAttributeByID(nrDocNum)
strnm = Dlg.GetAttributeByID(nrDocNm)
strCustom1 = Dlg.GetAttributeByID(nrCustom1)
strCustom2 = Dlg.GetAttributeByID(nrCustom2)
strCustom3 = Dlg.GetAttributeByID(nrCustom3)
Strdb = Dlg.GetAttributeByID(nrdatabase)
...
Can someone tell me why DeskSite 6.06 fails recognize "Sub EditProfileDlg_OnOK(dlg)"?
thank you,
Jason
Find more posts tagged with
Comments
jny
This has been reported as a bug in DeskSite6.6/FileSite4.1 and Worksite 8.0 HF4.
It looks like the code is collecting the profile input user has entered before the dialog closes. If so, you should be able to put the same implementation code in the EditProfileCmd_PreOnOK or EditProfileCmd_PostOnOK event instead, as the command events are fired successfully.
Migrateduser
Thanks jny.
I tried modifying the code as you suggested but it is behaving no different. I have attempted using both EditProfileCmd_PostOnOk(dlg) and EditProfileCmd_PreOnOk(dlg).
Could this be due to the reported bug with Desksite 6.6?
Could it be that I am using inappropriate naming conventions for these events? Unfortunatelly, I don't have the appropriate documentation to use as reference.
jny
That's strange. I tested them beforehand and they fired successfully in both 6.0/4.a and 8.0. Could you include the script you used?
Migrateduser
Sure, see below for the code...
Const nrDocNum = 1 ' Doc number
Const nrDocNm = 3 ' docname
const nrCustom1 = 25 ' Client
const nrCustom2 = 26 ' Matter
Const nrCustom3 = 53 ' Practice
Const nrdatabase = 0 ' database
Const nrAuthor = 5 ' Author
' NOTES
' Below are the event names I have tested
'
' Sub EditProfileCmd_PreOnOK(dlg)
'
' Sub EditProfileCmd_PostOnOK(dlg)
'
'
' This msg box displays so I know the script is processed this far
msgbox ("called")
Sub EditProfileDlg_OnOK(dlg)
Dim objDoc, strCustom1, strCustom2, strcustom3, strcustom4, strcustom5, Strdb
Dim strcustom6, strNum, strnm, cline, strcustom7
Dim Individ
' this msg box never displays which leads me to believe we never get this far.
msgbox ("called inside")
strNum = Dlg.GetAttributeByID(nrDocNum)
strnm = Dlg.GetAttributeByID(nrDocNm)
strCustom1 = Dlg.GetAttributeByID(nrCustom1)
strCustom2 = Dlg.GetAttributeByID(nrCustom2)
strCustom3 = Dlg.GetAttributeByID(nrCustom3)
Strdb = Dlg.GetAttributeByID(nrdatabase)
'set variables to be used by integration with practice, and document number
Dim mprac
mprac = dlg.GetAttributeByid(nrcustom3)
strDocnum = Dlg.GetAttributeByid(nrDocNum)
strDoc = cstr(strdocnum)
if mprac = "TRACKER" then
set cnconn = Createobject("ADODB.connection")
Cnconn.Open "DSN=Trackerdata"
if err.number <> O then
msgbox("Unable to locate the Immigration tracker database. Please contact the Systems Administrator.")
end if
Dim rssql, tloc, rs
tloc = "\\CDDATA\TrackerNRLs$\"+strdoc+".nrl"
Rssql = "Select * From Documents Where Location like '"+Tloc+"%'"
set rs = CreateObject("ADODB.Recordset")
rs.open rssql, cnconn, 1, 1
if not rs.eof then ' Document is already exists in Immigration Trackers for this client
rs.close
set rs = nothing
else ' Document is not in Dms add now
rs.close
set rs = nothing
rssql = "Select * From Individual Where clientnumber = '"+strCustom1+"' AND MATTERNUMBER = '"+STRCUSTOM2+"'"
set rs = CreateObject("ADODB.Recordset")
DIM PASS1, Contyes
PASS1 = 1
Do
PASS1 = PASS1 + 1
tryagain = "No"
rs.open rssql, cnconn,3, 3 ' Test for indivdual client and matter number exist.
IF RS.EOF OR RS.BOF THEN
MSGBOX("Individual was not found. Please check to make sure Immigration Tracker holds a client and matter number for this individual.")
tryagain = "Yes"
Contyes = false
rs.close
Else
Contyes = true
END IF
PASS1 = PASS1 + 1
if pass1 >= 6 then
tryagain = "No"
End if
Loop while tryagain = "Yes"
End if
'Msgbox rssql
If ContYes = true then
' test for multiples
DIM MNAME, Mindid, Mtloc, StrMsg
mtloc = "\\CDDATA\TrackerNRLs$\"+strDoc+".nrl"
MNAME = RS.FIELDS("ILAST").VALUE+" "+RS.FIELDS("IFIRST").VALUE
Mindid = rs.fields("Individ").value
Mstrid = cstr(Mindid)
Mtid = Mindid
rs.movelast
Mindid = rs.fields("Individ").value
if mtid = mIndid then
tloc = "\\CDDATA\TrackerNRLs$\"+strDoc+".nrl"
Dim Rs3
set rs3 = CreateObject("ADODB.Recordset")
rs3.open "Documents", cnconn,3, 3
rs3.addnew
rs3.fields("Docname").Value = strnm
rs3.fields("dateadded").value = DATE()
rs3.fields("Individ").value = Mstrid
rs3.fields("Location").value = Tloc
rs3.update
rs3.close
Dim fso
Dim txtStream, fileName
Dim strnrl
StrNrl = "MINTZDMS"+VBCR+"!nrtdms:0:!session:MINTZDMS:!database:"+strdb+":!document:"+strdoc+",1:"
fileName = "\\CDDATA\TrackerNRLs$\"+strDoc+".nrl"
Set fso = CreateObject("Scripting.FileSystemObject")
Set txtStream = fso.CreateTextFile(fileName, True)
' Write to the file
TxtStream.WriteLine strnrl
txtStream.Close
Set txtStream = Nothing
Set fso = Nothing
MSGBOX("Document has been added to Immigration Tracker"+VBCRLF+"Individual:"+MNAME+VBCRLF+_
+"File Name:"+strnm+vbcrlf+"Document Number:"+strdoc +VBCRLF+ _
+"Client Numer:"+strCustom1+vbcrlf+"Matter Number:"+StrCustom2)
Mupdated = true
else
'found multiple records with same client matter number
rs.movefirst
rs.movelast
mtl1 = rs.recordcount
rs.movefirst
MsgBox "There are "+cstr(mtl1)+" individuals with the same Client and Matter number combination."
'do while not rs.eof
'mtl1 = mtl1 + 1
'MsgBox mtl1
'Msgbox "Name:" +RS.FIELDS("ILAST").VALUE+" "+RS.FIELDS("IFIRST").VALUE
'rs.movenext
'loop
'rs.movefirst
'done with rs record set... close it
rs.close
mlt2 = 0
tloc = "\\CDDATA\TrackerNRLs$\"+strDoc+".nrl"
'is this being used elsewhere?
'set rs2 = CreateObject("ADODB.Recordset")
'rs2.open "Documents", cnconn,3, 3
'Msgbox "You have "+cstr(mtl1)+" individuals with the same Client and Matter number combination."
Mupdated = false
Mgo = true
Do while Mgo = true
FirstPrompt = "Enter Last Name of desired individual - Leave blank or click cancel to exit."
MLname = trim(lcase(InputBox(FirstPrompt,"Last Name")))
if MLname = "" then
'user entered nothing
mgo = false
else
'rs.close
'set rs = nothing
rssql = "Select * From Individual Where clientnumber = '"+strCustom1+"' AND MATTERNUMBER = '"+STRCUSTOM2+"' and Ilast = '"+Mlname+"'"
'set rs = CreateObject("ADODB.Recordset")
rs.open rssql, cnconn,3, 3
if rs.eof then
msgbox "No Individual with that last name was found. Please check your entry."
rs.close
Else
'records found
do while not rs.eof
mlt2 = mlt2 + 1
mname = ltrim(rs.fields("Ilast"))+", "+rs.fields("IFirst")
Mstrid = rs.fields("Individ").value
'strmsgcnt = "Record "+cstr(mlt2)+" of "+cstr(mtl1)
strmsg = "Do you want to Add this document to "+vbcrlf+mname
If MsgBox(strMsg, vbQuestion + vbYesNo, "Adding Document to Immigration Tracker.") = vbYes then
set rs2 = CreateObject("ADODB.Recordset")
rs2.open "Documents", cnconn,3, 3
rs2.addnew
rs2.fields("Docname").Value = strnm
rs2.fields("dateadded").value = DATE()
rs2.fields("Individ").value = Mstrid
rs2.fields("Location").value = Tloc
rs2.update
'Dim fso
'Dim txtStream, fileName
'dim strnrl
StrNrl = "MINTZDMS"+VBCR+"!nrtdms:0:!session:MINTZDMS:!database:"+strdb+":!document:"+strdoc+",1:"
fileName = "\\CDDATA\TrackerNRLs$\"+strDoc+".nrl"
Set fso = CreateObject("Scripting.FileSystemObject")
Set txtStream = fso.CreateTextFile(fileName, True)
' Write to the file
TxtStream.WriteLine strnrl
txtStream.Close
Set txtStream = Nothing
Set fso = Nothing
MSGBOX("Document has been added to Immigration Tracker"+VBCRLF+"Individual:"+MNAME+VBCRLF+_
+"File Name:"+strnm+vbcrlf+"Document Number:"+strdoc+VBCRLF+_
+"Client Numer:"+strCustom1+vbcrlf+"Matter Number:"+StrCustom2)
Mupdated = TRUE
mgo = false
rs2.close
set rs2 = nothing
end if
rs.movenext
loop
rs.close
end if
End if
loop
end if
if mupdated = false then
MsgBox "Document was not imported into Immigration Tracker. Please contact your system administrator."
end if
Else
MsgBox "Document was not imported since its already listed in Tracker. Please contact your system administrator."
End if
end if ' not imma
End Sub
Jny, I appreciate your help. Thanks again for your time.
jny
In this script, you have both PreOnOK and PostOnOK events commented out, so those events would not have fired.
I tested in both 8.0 HF5 and the latest 6.6 and both suggested command events, NewProfileCmd_PreOnOK and NewProfileCmd_PostOnOK, do fire successfully.
Migrateduser
Thanks jny. I intended on commenting out those lines... I left those events in the code for testing and so I would not have to type them again. I am not sure what could be causing this then. I'll see if I can test this again to make sure I am not missing anything.