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.
34
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 = “”) {
    skip();
    }
    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!

How to change the PageOut drag and drop setting …

  1. Open the PageOut, click on Format and select Guide Settings… which triggers a dialogue box
  2. Check Snap to grid to enable you to drag and drop components in a much more orderly and structured manner – it keeps the component inline with the horizontal and vertical gridlines.
  3. Uncheck the checkbox Snap to grid to enable you to drag and drop components in much more unstructured manner which gives you complete freedom to move a component anywhere you like on the grid.

Watch the video below for a demonstration!