Ideally, I'd like to write "TextToIntegerIdentifier" and "TextToLongIntegerIdentifier" functions (client and server actions) which would first attempt to convert a Text input parameter to an Integer or Long Integer respectively, and if successful return that value cast as a generic Integer Identifier or Long Integer Identifier type (otherwise, return NullIdentifier()); however, it does not seem to be possible to set the variable type of the output parameter to a generic Integer Identifier or Long Integer Identifier. Is there a way to do this?
Thanks!Kirk
Hi Kirk,
OutSystems doesn't have a "Generic Identifier" data type, so you'll have to use Integer/Long Integer as the data type for your function's output. This will result in a warning message when you use that function in an aggregate filter, but I'd say you can safely ignore it. If you don't want to ignore the warning, you could wrap the function call with "IntegerToIdentifier/LongIntegerToIdentifier".
Hi,
I am curious, why you need such functions?
Regards,
Daniel
Need’s a strong word, it really would just simplify things for me a bit. I would like the ability in one single function call filter an aggregate by comparing a string input parameter to the Id of one of the entities. I can’t really convert the Id to Text, because I’m padding the Id with leading zeros, and so if I convert the Id to a string it’ll fail to match Id 1 if I enter “0000001.”
I realize I can fairly easily accomplish what I’m trying to do by first converting the Text to an Integer or Long Integer, then using the appropriate function to convert the output to an Identifier, but I’m wondering if there’s a way I can get it done with one function call.
Thanks, that’s what I’ve done.