1

we have a functionality where users get an email with a link to a Salesforce site (that hosts a VF Page). Once they click on the link in the email it takes that that that site. But I am struggling to generate a string that will dynamically generate URL in my class.

I am working in a scratch org and created a Domain and Site; my final URL looks like this for the site: https://sandbox-xyzwys.cs68.force.com

But Prod already has domain activated and other sites created (so does full sandbox). So when I migrate work to full sandbox and Prod my site migrates over, but its URL changes: https://dev-ABCDZ.cs70.force.com

If I query Domain SELECT Domain,DomainType,Id FROM Domain it returns nothing in my scratch org and does return completely different Domain in the sandbox: https://dev-QAZXSW.cs70.force.com

Please help me generate a string that will dynamically crate a valid URL that can be referenced in APEX and can be easily migrated between the orgs.

closed as off-topic by glls, Mohith Shrivastava, battery.cord, Raul, Pranay Jaiswal May 9 at 10:06

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on problems in code you've written must describe the specific problem and include valid code to reproduce it. For help writing short, self-contained syntactically-valid examples, see: SSCCE.org" – glls, Mohith Shrivastava, battery.cord, Raul, Pranay Jaiswal
If this question can be reworded to fit the rules in the help center, please edit the question.