Print IF DataSource Equals Other DataSource Follow

0
Avatar
Christian Vargas

I need to set the following:

 

-- OnPrintJobStart

    -- IF "Named Data Source A" = "Named Data Source B"

        -- THEN DON'T Print

            -- INSTEAD display custom message

 

Please let me know how to set this in the correct SYNTAX in the VB SCRIPT Editor

3 comments

1
Avatar
Shotaro Ito
Comment actions Permalink

 

When you have any condition, you can cancel print with error message.

Ex:

1. Create Named Data souce "VAR1" which have value (database field etc) 

2. Create a text  with VB Script source (Event control script)

OnNewRecord (or OnPostPrompt) event

If Format.NamedSubStrings("VAR1").Value = "CAT" Then
Call Format.CancelPrinting("CAT prohibited","") ' No continue button - cancel only
'Format.CancelPrinting("CAT prohibited") ' With continue button
End If

 

0
Avatar
Christian Vargas
Comment actions Permalink

I will try this tomorrow and report back. Thanks.

0
Avatar
Christian Vargas
Comment actions Permalink

This worked! Exactly as posted :-)

Please sign in to leave a comment.