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
  • +1
    Certified Lead Developer
    in reply to Daniel Hua

    Sure. See below code:

    a!localVariables(
      local!recordData: {
        'recordType!{ad927cfe-f590-436e-a37f-9a73818be10a}AAD Attendee'('recordType!{ad927cfe-f590-436e-a37f-9a73818be10a}AAD Attendee.fields.{4424ccce-aeb2-49e1-b28f-07099a8476ed}id':1),
        'recordType!{ad927cfe-f590-436e-a37f-9a73818be10a}AAD Attendee'('recordType!{ad927cfe-f590-436e-a37f-9a73818be10a}AAD Attendee.fields.{4424ccce-aeb2-49e1-b28f-07099a8476ed}id':2),
        'recordType!{ad927cfe-f590-436e-a37f-9a73818be10a}AAD Attendee'('recordType!{ad927cfe-f590-436e-a37f-9a73818be10a}AAD Attendee.fields.{4424ccce-aeb2-49e1-b28f-07099a8476ed}id':3),
      },
      a!map(
        type: typeof(local!recordData),
        typeName: typename(typeof(local!recordData)),
        compare: typeof(local!recordData) = a!listType('recordType!{ad927cfe-f590-436e-a37f-9a73818be10a}AAD Attendee')
      )
    )

Children
No Data