Read Field Script-Created Values With Document.onnewrecord Follow

0
Avatar
Legacy Poster

I have a number of fields that use multi-line vbScript to set their values. I need to show/hide their respective caption fields, based on the values in the data fields.

I tried creating the following document.OnNewRecord code to hide the captions when the field is blank, but it does not work:

If Format.Objects("ItemID").Value = "" Then
Format.Objects("ItemCaption").PrintVisibility = False
End If

The problem (I suspect) is that the vbScript in OnNewRecord runs before the script in the data field, which means it always sees a blank value, thus, the captions are always hidden.

Any suggestions?

Thanks

2 comments

0
Avatar
Shotaro Ito
Comment actions Permalink

Try the other way -
On Text "ItemCaption"s Datasource, Transform > VB Script (OnProcessData Event)
[code]If Format.Objects("ItemID").Value = "" Then Value = ""[/code]
(Ignore warning of not using "Value" in datasource upon close.)
0
Avatar
Legacy Poster
Comment actions Permalink

This worked perfectly. Thanks for your assistance.

Please sign in to leave a comment.