Variable Text Box not Updating S’abonner

0
Avatar
Seb Atkins

I have 2 forms for my label. 

 

Hi all,

 

My WorkFlow/Idea:

We see 2 prompts asking for a sales order number and its suffix. These are entered and we go onto Form 1

Form 1 shows me a record picker where we pick records from.

Form 2 asks how many items we want to receive in. This input box is set as a named data source - "QtytoReceive"

Once input form 3 appears and it should show me how many items I should be sampling based on the input box using a VB script. 

 

My VB script runs as an event control and is below:

if ((Format.NamedSubStrings("QtytoReceive").Value > 0) and (Format.NamedSubStrings("QtytoReceive").Value < 16)) then value = 2 else _
if ((Format.NamedSubStrings("QtytoReceive").Value > 15) and (Format.NamedSubStrings("QtytoReceive").Value < 26)) then value = 3 else _
if ((Format.NamedSubStrings("QtytoReceive").Value > 25) and (Format.NamedSubStrings("QtytoReceive").Value < 91)) then value = 5 else _
if ((Format.NamedSubStrings("QtytoReceive").Value > 90) and (Format.NamedSubStrings("QtytoReceive").Value < 151)) then value = 8 else _
if ((Format.NamedSubStrings("QtytoReceive").Value > 150) and (Format.NamedSubStrings("QtytoReceive").Value < 1201)) then value = 10 else _
if ((Format.NamedSubStrings("QtytoReceive").Value > 1200) and (Format.NamedSubStrings("QtytoReceive").Value < 3201)) then value = 15 else _
if ((Format.NamedSubStrings("QtytoReceive").Value > 3200) and (Format.NamedSubStrings("QtytoReceive").Value < 10001)) then value = 20 else value = 25

 

The script works fine. It calculates the correct quantities.

 

My Issue:

No matter where I place my script on any event control the script is always working off the value entered for the previous record. 

 

Is there a way to execute the script on form load or only when my text input box is updated? I've spent hours Googling and trying to work this out and all out of ideas. 

 

Any help would be great guys. 

 

Thanks. 

 

2 commentaires

0
Avatar
Peter Thane

The only way I could get the value to appear was to make the field an embedded field and add in the above VB into the Transforms VB Script option, including a Value = Value at the end .

This does not populate the data entry screen field, however, if you add a Preview of the Template as a picture onto the form then the value does show on this. 

 

0
Avatar
Seb Atkins

Morning,

 

thanks for your reply...I'm not on Bartender right now but if this is right, then perhaps I can some way crop around the template to focus in on just that particular field on there which would make it look like its doing as we wanted! Cheers. I hadn't thought of it this way. 

 

I'll look into this and let you know how I get on. Thanks again for the help. 

 

Regards 

Veuillez vous connecter pour laisser un commentaire.