Home
TeamSite
NRS Script CloseOnOK issue
pennyg
Hi
I have a FileSave.nrs script which has a test when the user clicks Save. It is testing for various values and then prompting the user based on the results.
If the user clicks NO we need to stop the save process, allow the user to change a setting and then click Save again OR be able to Cancel out completely.
Based on SDK and other information it appears that we need to use dlg.CloseOnOK = False and Context.Add "iManExt.DoOK", False to stop the save process which works perfectly however it leaves the 'Save' button disabled and the Cancel button doesn't function.
If I add the code dlg.CloseOnOK = true and Context.Add "iManExt.DoOK", true to the cancel button this closes the dialog box but saves the document as a new document which is not what is required - we just want a cancel.
We are using enhanced dialog boxes and iManage 8.2.
Code sample:
Sub IManFileSaveCmd_PreOnOK(dlg)
' code with tests leading up to this point has been removed.
response = msgbox ("You are about to save into the KD. Is this correct?", vbYesNo)
if response = VbNo then
dlg.CloseOnOK = False
Context.Add "iManExt.DoOK", False
end if
End Sub
Sub IManFileSaveDlg_OnCancel(dlg)
dlg.CloseOnOK = True
Context.Add "iManExt.DoOK", true
End Sub
Any help would be greatly appreciated.
thanks P.
Find more posts tagged with
Comments
robcom
I seem to have hit the same issue with the 8.5 and EAI dialogs. I wil probably re-ask the question.
pennyg
Hi
following some additional research I came across a reference to the blCallFromIntegration lines below and with some playing around I found the following worked for me.
Dim blCallFromIntegration
blCallFromIntegration = Context("CallByFileSaveAs")
'This context item is only present in integration
If True = blCallFromIntegration Then
Context.Add "FileSave.DoOK", False
' used from the File Save option
else
Context.Add "iManExt.DoOK", False
' use when dragging an external file into FileSite
end if
dlg.CloseOnOK = False
I hope this helps
robcom
Thanks for this. I realised (and put in a similar post) that I was working wit a more 'up to date' client and needed to use the filesave.nrs script. Not the old EditProf.nrs for my non-Matter Centric client I normaly do work for.