How to control the display of a label based on the value of a spool-field

SCENARIO: Some of your customers require their VAT number to be displayed on the invoice document. Your M3 customer master file only has the VAT number for several customers however you do not want to have the label VAT Number appearing with no accompanying value on an invoice.

  1. Open the OIS1990H event and transform the spool-field 0HWYVRNO into a variable 
  2. Open the PageOut and insert a Static Text object (this will be your label) to your canvas
  3. Rename the label to VAT Number
  4. In the Message window, collapse the Variable folder and drag the variable $0HWYVRNO to your canvasto the right/below of the label.
Figure 1: The Variable folder on the PageOut canvas
  1. Right-click on the label and select Edit Script…
  2. Insert the following code:

    if ($0HWYVRNO = “”) {
    else {

The label VAT Number will now only appear if a value exists for the spool-field 0HWYVRNO. If the spool-field 0HWYVRNO value is blank then the label will be skipped (i.e. not appear).

Export and deploy and test!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s