How can I use cast() in an expression to cast something to an array of a CDT? I

Certified Senior Developer
How can I use cast() in an expression to cast something to an array of a CDT? I can cast to a single version of the CDT with cast('type!{namespace}type-name',{fieldName:ri!fieldName}) How can I do this with multiples?

I've been browsing the docs, if there is a good page that explains this I would appreciate the pointers. I think that cast() documentation could be enhanced with some additional examples, too. Thanks!...

OriginalPostID-91434

OriginalPostID-91434

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer
    As an example: I have a Rule that takes an array of a CDT as a parameter, however I have to specify "Any Type" for the parameter. If I want to explicitly cast it to the array of the CDT before using it in the rule, is there a way to do this? I could do it for a singular CDT as

    =with(a:cast('type!{namespace}type-name',{ri!myCDTParameter}), expression_that_uses_the_cdt)
Reply
  • 0
    Certified Senior Developer
    As an example: I have a Rule that takes an array of a CDT as a parameter, however I have to specify "Any Type" for the parameter. If I want to explicitly cast it to the array of the CDT before using it in the rule, is there a way to do this? I could do it for a singular CDT as

    =with(a:cast('type!{namespace}type-name',{ri!myCDTParameter}), expression_that_uses_the_cdt)
Children
No Data