Unable to Print By using VB Scripts Follow

0
Avatar
Sandesh Mekala

Hello,

We are trying to modify a data provided and print a new field using VB Scripting. We are using Bartender 10.1SR4 with commander. The  Label Format uses the a txt as a database file. Below is how the database file and the trigger file for commander looks like. The trigger file contains the commander script, first line as header followed by the actual data.

Database.txt
label_request_id_string|label_request_id|site_string|site|whse_string|whse|inspection_flag_string|inspection_flag

Trigger.dd
%BTW% /AF="c:\labels\format\receipts.btw" /PRN="label_war_room" /P /D="%Trigger File Name%" /C=1 /R=3
%END%
LabelRequestIdString|LabelRequestId|SiteString|Site|WhseString|Whse|InspectionFlagString|InspectionFlag
Label Request Id|553|Site|TEST|Whse|100003|Inspection Flag|1

VB Script Being Used for a New Single Line Text Field
IF Field("Database.inspection_flag") ="1" Then value="INS" Else value="NEW" End if

Also Tried EventControlScripts OnNewRecord with the same script as above.

1 comments

0
Avatar
Shotaro Ito
Comment actions Permalink

Looks like the script should go to Multiline script instead of single line script.

 

Besides, you don't need VB Script  for such condition - you can do that in Datasource > Transform tab's Search and replace transform.

Action1: Search and replace, Regular Expression, Search ^1$ replaced by INS

Action2: Search and replace, Regular Expression, Search ^(?!^INS$).+$ replaced by NEW

Please sign in to leave a comment.