Message 1 of 2
Displayname code issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I have this code snippet that I have been using to overwrite the Displayname of the active document in the model browser. Code works as intended when I trigger it in existing documents but I have a problem with new documents that require an initial save.
Most probably the cause is that Part number is generated after the rule is ran.
Dim oDoc As Document = ThisDoc.Document
Try
oDoc.DisplayName = iProperties.Value("Project", "Part Number") & " (" & iProperties.Value("Custom", "Part Name") & ")"
Catch
iProperties.Value("Custom", "Part Name") = ""
End Try
oDoc.Update
My intended use would be to embed the rule into a template file and trigger it when iProperties are changed.
When a user creates a new document, fills out the iProperites (rule trigger), saves and checks the file into Vault the Displayname should be filled like Part number (Part name) (picture).