02-16-2016
11:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
02-16-2016
11:22 PM
Hi, you mean this one below? I send it to you as a tool so you can use it as a separate rule to test your code.
It just checks if the parameter "SIZE" exists and if so then it will pick the first value (so you dont need to go to parameters and look for it).
The zero in the ".Item(0)" means it will pick the first item, because it starts numbering from zero instead of one.
So if we will change it to "MultiValue.List("SIZE").Item(1)", it will pick the second item from the list.
Try
' Atempt to read the parameter "SIZE"
Parameter("SIZE") = Parameter("SIZE")
' If it doesn't throw an error then it will pass here,
' so we can pick the first item from the list in "SIZE" parameter
Parameter("SIZE") = MultiValue.List("SIZE").Item(0)
Catch
' If the reading of the parameter fails, the "Try" command will send us here
' As the reading of the parameter failed we can assume it doesn't exist
MsgBox("The parameter 'SIZE' doesn't exist")
End Try
Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
- - - - - - - - - - - - - - -
Regards,
Mike
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods