Script to Provide Incr-Decr Clear Value

 Description

How to create an increment/decrement clear value for use with an LPS file drop.

LPS file drop does not provide for a clear value, however with the use of this script, a static clear value can be set if one is not provided in the pas/xml file drop.

Steps

To provide a clear value for incrementing and decrementing fields when the starting value can not be provided in the dropped file (.pas, .xml, .csv, etc.) due to front end system constraints, follow these steps. 

  1. Set up a scripting field and an incr/decr data source field.
  2. Modify the example below using the names of the fields on your label.
  3. Copy the modified script into the scripting field data source window.
Copy
Sample script
<pre class="syntaxhighlighter-pre" xml:space="preserve">var INCREMENT = String(label.fields.field.(@name == 'INCREMENT').@data);

if (INCREMENT == "")
{
//define clear value
 label.fields.field.(@name == 'INCREMENT').@data = "001";
}
 </pre>