I have a view with documents, response documents and response-to-response documents. The form-names are “business”, “person” and “contact”.I have an view-action which creates a new document, but this has to be only possible when a certain document is selected. A new business-document is always possible, but a new person-document should only be created when a business-document is selected in the view.
I created a script which looked for the selected document with the following code:
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument
If Not doc.form(0) = “business” Then
Messagebox “Please select a business-document”,48,“Error”
Else
Call w.ComposeDocument( “”, “”, “person” )
End If
This works fine, but I prefer only displaying the action which are permitted.
I thought: “Wow, the new @GetField formula in Designer 6”. This works in an action button which displays the value of a form-field. But when I use this code in the hies-when formula, it does not work.
(The hide-when formula is: @If(@GetField(“form”)=“person”). This should hide the action when the selected document is a person-doc.
How to get this implementation work ?