Select to view content in your preferred language

ParameterType property writable

455
1
03-01-2016 05:32 AM
Status: Closed
Labels (2)
It would be quite useful if the ParameterType property in ToolValidator was also writable, not read-only as it is now.
When you can disable a parameter, it should be possible to make it optional!
:-)
1 Comment
DavidWynne
Status changed to: Closed

While we can't change the parameter type property, there is an approach to mimic the behavior you're looking for. 

The strategy is to flip this around, and define the parameter as optional. And then in the tool's validation code, using your specific criteria, make the parameter appear required through validation, by forcing a parameter error. If you use either the 530 or 735 error ID in validation, the parameter will then show as required.

There's more information here in the Parameter topic:

DavidWynne_0-1706641833349.png

 

-Dave