Skip to content

Add New Rule - HardcodedOrgUrl #204

@tomkittlabs

Description

@tomkittlabs

I'd like to suggest adding a new rule to help users identify hardcoded Salesforce instance URLs within their Flows e.g. 'Click Here' links to records or pages in Screen Flows

Current Behaviour:
The scanner currently doesn't specifically flag hardcoded Salesforce URLs (e.g., https://mydomain.my.salesforce.com) found within formulas, text templates or other Flow metadata components.

Proposed Enhancement:
Adding a new rule named HardcodedOrgUrl

  • Description: Detects hardcoded Salesforce instance URLs within Flow formulas, text templates, or potentially constants/element inputs.
  • Expected Behaviour: The scanner flags these hardcoded URLs with a warning.
  • Justification: Hardcoding URLs hinders portability between environments (sandboxes > production) and makes maintenance difficult. Best practice encourages using dynamic methods like $Api global variables, Custom Labels or Custom Metadata.
  • Implementation Notes: Rule would need to scan relevant string properties using regex

Purpose:
This rule would directly address a issue of deploying Flow between environments with changing environment URLs. By encouraging the use of dynamic references, it helps users build Flows that are easier to deploy and manage across different Salesforce orgs. This aligns with the project's goal of improving Flow quality through static analysis.

Docs:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions