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)
NRS Script \ Saving CUSTOM2 field
tfazzone
Hi all,
I'm having some difficulty getting an NRS script to save values entered into CUSTOM2.
In my example, I would like to enforce a certain client/matter type if the database location is on a certain library:
Sub NewProfileCmd_PreOnOK(dlg)
Const nrCustom1 = 25
Const nrCustom2 = 26
Database = dlg.GetAttributeByID(nrDatabase)
If Database = "MYDB" Then
dlg.SetAttributeValueByID nrCustom1, "NA", true
dlg.SetAttributeValueByID nrCustom2, "NA", true
MsgBox "The matter value is : " & dlg.GetAttributeByID(nrCustom2)
End If
End Sub
Now, nrCustom1 will be entered and saved correctly. nrCustom2 is reported correctly in the MsgBox statement, but when you view the profile, Custom2 is still set to NULL.
Any advice/tips on debugging would be greatly appreciated.
-Tony
Find more posts tagged with
Comments
reesbevan
Just seen a technote on exactly this: 82005-1327
Issue/Symptom:
Disabling the Custom2 field via dlg.SetAttributeValueByID does not work in the EditProf.nrs script.
Status:
This issue has been resolved in Hotfix 1 for FileSite 8.0 SP1 and DeskSite 8.0 SP1 (Target Release: 9/30/05).
Allan
tfazzone
Thanks for pointing out the TechNote, Allan.
I'm not sure that this is cause of the issue, however, because:
1) I am testing off of FileSite 8.1
2) The NULL behavior occurs even when I do not disable the field.
If the TechNote is related, perhaps there needs to be a code merge in 8.1?
Filesite 8.1.1 HF1 just came out, so I'll give it a test under that version.
-Tony
tfazzone
As a followup -- I got an answer from DevSupport on this issue. Here is the code you need to add as a workaround:
Option Explicit
Const nrCustom1=25
Const nrCustom2=26
Sub NewProfileCmd_PostOnOK(dlg)
dim importedDoc 'As IManDocument
set importedDoc = Context("ImportedDocument")
with importedDoc
.SetAttributeByID nrCustom1, "MY_CLIENT"
.SetAttributeByID nrCustom2, "MY_MATTER"
.Update
msgbox .Number & "_" & .Version & _
VBCRLF & .GetAttributeByID(nrCustom1) & _
VBCRLF & .GetAttributeByID(nrCustom2)
end with
End Sub