Skip to main content
May 6, 2025
Question

Using match function inside a recordlink

  • May 6, 2025
  • 6 replies
  • 0 views

I am trying to open record summary for requests but whatever record I open I'm getting record doesn't exist. I attached my code I can understand something is wrong but couldn't get what I was missing.  The ri! Request relation is of type request relation. Anyone can help?

a!sectionLayout(
  contents: a!forEach(
    items: ri!RequestRelation,
    expression: a!cardLayout(
      contents: {
        a!linkField(
          links: a!recordLink(
            label: "link",
            recordType: 
              a!match(
                value: index(
                  a!queryRecordByIdentifier(
                    recordType: 'recordType! Request',
                    identifier: tointeger(fv!item[requestRelation.field.AppId])
                  ),
                  'recordType! Request.fields.applicationId',
                  {}
                ),
                equals: 212,
                then: 'recordType!ABC',
                equals: 213,
                then: 'recordType!ARC',
                default: null
              ),
            identifier: a!match(
              value: index(
                a!queryRecordByIdentifier(
                  recordType: 'recordType! Request',
                  identifier: tointeger(fv!item[requestRelation.field.AppId])
                ),
                'recordType! Request.fields.applicationId',
                {}
              ),
              equals: 212,
              then: 'recordType! Request.relationships.ABC.fields.requestId',
              equals: 213,
              then: 'recordType! Request.relationships.ARC.fields.requestId',
              default: null
            )
          )
        )
      }
    )
  )
)

6 replies

harshas2775
May 6, 2025

Few questions:

Is 'applicationId' the primary key in Request record? 

in the value attribute, possible values are  'recordType! Request.relationships.ABC.fields.requestId', 'recordType! Request.relationships.ARC.fields.requestId', and null. Here, you are not passing any data from rule input or variable instead directly request Id field is mentioned from the record. This seems fishy! 

May 6, 2025

No application id is not primary key, I'm getting the ri! requestrelation from record picker value where the request id getting selected , so based on that id I'm trying to open the particular record summary. So using the queryrecordidentifier I'm trying to get application id

harshas2775
May 6, 2025

Here, the identifier should have the primary id value for record data  to return details for. You are passing AppId from requestRelation as identifier to Request record. If AppId doesnt hold primary id value for Request record your output will not be appropriate. So start with passing it correct field/value to query Request record with

 

 a!queryRecordByIdentifier(
                    recordType: 'recordType! Request',
                    identifier: tointeger(fv!item[requestRelation.field.AppId])
                  ),