Running A Script Depending On Serialization Follow
Hi,
How do I change a value of a field during print depending on value of "Number of serialized labels"?
The script I wrote below that is being called OnProcessData for the serialized Text Object, I cannot get the condition to return True.
Field 1 sets the "number of serialized labels" e.g. 11
Value is Text Object that increments by 1 on serialization (screen data, with serialization options)
I want to change a value on a separate field ("Field 8") on the last serialized label but I cannot get the conditional statement to return True.
If Value = Field("'sleevestickerS$'.Field 1") Then
Field("'sleevestickerS$'.Field 8") = "1000"
End If
I hope I was clear on my explanation. I appreciate your advise.
4 comments
The field references are read only. However, as they their ultimate purpose is to be used in a data source value of a label object you would instead set the value of the data source rather than the database field. This is what your code should probably look like:
If Field("sleevestickerS$.Field 1") = X Then value = "1000" End If
Where X is whatever value you are testing for.
Hi,
The other issue I am having is I am trying to set X to be the serialized value that Bartender is generating, and then use this X in conditional statement as you pointed out. But I do not know how to do this or if Bartender can do this. I tried to use the lines of code, but failed:
Dim X
X = Format.Objects("Text 7").Value //issue here, how do I get the value of the current serialization number during print time? Text 7 is a screen data text object that increments by 1during print
If Field("sleevestickerS$.Field 1") = X Then
value = "last label" //other calculation
End If
I have attached screenshot, csv and btw files of what I am trying to do.
Regarding the attached screenshot: what I am currently doing now is manually crossing out the last labels "Pcs in box" value and writing the remainder by hand...
Thank you for your advice,
Hi,
I am trying to do exactly the same process.
Can anyone tell me how to read the value of the serialization so I can run use the serialization number in my calculations.
Thanks
Hi I have now managed this.
Strange way of doing it but this seems to have worked.
Create a new Text Object on the label.
Use the VB "Event Control Scripts" Script for "ON Serialize Event"
Create a variable and set it as a counter
Dim BoxPos
BoxPos = BoxPos +1
You can now use this value in your calculations.
Hope this helps.
Please sign in to leave a comment.