0

Would be possible to do an IF here to say if a url is Sandbox.my.salesforce use this url and if it doesn't follow this other one?

This formula is combining elements of an aloha redirect into a clickable link, it works in sandbox and prod but I have to make adjustments. We're wanting to bullet proof this so it works in a sandbox after a refresh.

Prod

SUBSTITUTE(
           LEFT($Api.Partner_Server_URL_260,FIND("/services", $Api.Partner_Server_URL_530)),
           '.my.salesforce.com/',
           '--c.vf.force.com/one/one.app#/alohaRedirect/apex/Medical_Inquiry_fulfillment_view_vod?id=' 
           & Id
           &"&Account="
           & Account_vod__c
           & "&retUrl=01r4x000000JcfF"
        )

Sandbox

SUBSTITUTE(
           LEFT($Api.Partner_Server_URL_260,FIND("/services", $Api.Partner_Server_URL_530)),
           '.sandbox.my.salesforce.com/',
           '--c.vf.force.com/one/one.app#/alohaRedirect/apex/Medical_Inquiry_fulfillment_view_vod?id=' 
           & Id
           &"&Account="
           & Account_vod__c
           & "&retUrl=01r4x000000JcfF"
        )

Thanks

  • $Api.Partner_Server_URL_530 if you're using myDomain will have .sandbox.my. in its value and you can exploit that – cropredy Jun 07 '23 at 17:27
  • 1
    You can review this: https://salesforce.stackexchange.com/questions/120400/differentiate-production-sandbox-instance – manjit5190 Jun 07 '23 at 17:28
  • FULL

    Dynamic (BROKE)

    https://COMPANYNAME--full.sandbox--c.vf.force.com/one/one.app#/alohaRedirect/apex/Medical_Inquiry_fulfillment_view_vod?id=

    Working LINK through UI

    https://COMPANYNAME--full--c.sandbox.vf.force.com/one/one.app#/alohaRedirect/apex/Medical_Inquiry_Fulfillment_View_vod?id=

    Prod

    DYNAMIC (WORKING)

    https://COMPANYNAME--c.vf.force.com/one/one.app#/alohaRedirect/apex/Medical_Inquiry_fulfillment_view_vod?id=

    It just may not be possible to make this work, since I'm having to build this URL and because there being that --full-- reference

    – Koolzero Jun 07 '23 at 18:51

0 Answers0