urlforrecord() Function Question

URL for a Record Type

urlforrecord(cons!myrecordtype,null) returns https://records.appian.com/suite/tempo/records/type/V1muDw/view/all in TEMPO.

I want to open them within the same site on the same page.

How do I achieve this?

Currently with my code it opens in a new tab. I want it to open in the same tab.

  Discussion posts and replies are publicly visible

  • Hi Aneesh,
    You may refer below code snippet to create record link to open record within the site. 

    ri!uniqueId is the primary key for your record type.

    load(
    local!siteUrl: cons!YOUR_SITE_URL,
    local!sitePage: cons!YOUR_SITE_PAGE,
    local!record: index(
    index(
    a!recordLink(
    recordType: cons!RECORD_TYPE,
    identifier: ri!uniqueId
    ),
    "@attributes"
    ),
    "@anyattribute",
    null
    )._recordRef,
    local!siteUrl & "/page/" & local!sitePage & "/record/" & local!record & "/view/summary"

    )

  • Actually the above is not my issue. I know how to display the summary page of a particular record in the same tab and the same page but what I want to do is to display the RECORD LIST (Not individual record summaries/views) in the same tab and same page.

    Currently, this code opens it in TEMPO and in a new tab. I want to open it within the same tab and within the same SITE and PAGE.

    Any idea?

  • 0
    Certified Lead Developer

    SafeLink (which you have to use in conjunction with URLForRecord()) always opens in a new tab, as you've noticed.  There is no way around this that I know of.

    It seems that a!recordLink() does not currently have a way to link to the record type listing as opposed to an individual record entry, so you might be forced to utilize the safeLink() and just deal with it opening in a new tab - but as far as opening it in the same site, you should be able to reformat the URL being returned from urlForRecord() to match the format used by Sites.  I believe this has been discussed in prior posts here and, if i remember correctly, others may have already posted example code for this, so it might be worth searching for a bit.