How do I check if a return of an expression rule is a specific record type?

Certified Senior Developer

I have an expression rule will return 2 types of record type

- Case

- Error

depends on if there is any error occur during the expression rule process

so when I get the result from the expression rule, I do need to know what type is the returned value,

how can I achieve that?

I tried to use typeof(), but it does not work. I am wondering if I need to use type!, but I do not know how to write a valid reference using type!

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    I have an expression rule, in the expression rule I call an integration to GET data from an external API. so it is possible API request failed due to network issue or server down. if it is succeeded, it should return a list of Case instances (a list of record types), but if it fail, it will return an instance of Error (one single record type)

    So from the caller that calling the expression rule, I need to identify if the instances returns are list of Cases or a single Error, then I can write to database accordingly

Children