Skip to main content
February 5, 2023
Solved

Expression evaluation error at function a!safeLink [line 31]: tool link - https://www.google.com/ is not a permitted URI under the configured security rules and cannot be cast to safeUri. (APNX-1-4198-000)

  • February 5, 2023
  • 6 replies
  • 0 views

Hi Team,

I am using the below code snippet for the links column and separating multiple links using semicolons. 

a!gridColumn(
  label: "Links",
  sortField: 'recordType!LA Record Link.fields.links',
  value: a!richTextDisplayField(
    label: "Real Links",
    value: a!forEach(
      items: split(fv!row['recordType!LA Record Link.fields.links'], ";"),
      expression: a!richTextItem(
        text: fv!item & char(10),
        link: a!safeLink(
          uri: fv!item,
          openLinkIn: "NEW_TAB"
        ),
        linkStyle: "STANDALONE"
      )
    )
  )
)

But when the user is inserting a link with the below text
tool link- https://www.google.com/  it is giving an error tool link - https://www.google.com/ is not a permitted URI under the configured security rules and cannot be cast to safeUri. (APNX-1-4198-000).

Even the tool record type interface is not working until I delete the record from the database. 

We tested multiple cases and found if we write anything before the https:// it is giving the same error. Is there any possible way to resolve it like whatever we write inside the link column it should take it as link?

I am attaching the error screenshot as well.

Could someone please help me with this?

Thanks

Kundan

Best answer by jaideepb0002

try this

if(find("https",ri!name,1),concat("https",split(ri!name,"https")[2]),
if(find("http",ri!name,1),concat("http",split(ri!name,"http")[2]),
ri!name))

6 replies

harshitb6843
February 5, 2023

It is expected as it is not a link, rather it includes a link. Why not just remove the "tool link" from the text and only keep it as "https://www.google.com"?

February 5, 2023

Hi [mention:ef600ff8f5d2497eb2def2126dc89484:e9ed411860ed4f2ba0265705b8793d05]

Yes, we can remove it.

Is it possible that if we change something in the code and this error will not come? As users may do this mistake and because of this we are getting a blocker that all the users can not use the application until I delete or rectify this record from the production database.

jaideepb0002
February 6, 2023

try this

if(find("https",ri!name,1),concat("https",split(ri!name,"https")[2]),
if(find("http",ri!name,1),concat("http",split(ri!name,"http")[2]),
ri!name))

February 6, 2023

Hi [mention:8321a34a541549869d0281e52d74bc85:e9ed411860ed4f2ba0265705b8793d05]

Thanks for responding. This worked fine.

Best

Kundan