How to retreive domain name from salesforce orgCan I simply disable an automatically created identity provider?Can not log into org with 'My Domain' due to HSTSdomain name in our orgCan the My Domain feature support multiple domainsRisks of deploying My Domain before the upcoming instance refresh?How to get your Custom Domain Name if you have Mydomain enabled - using Apex?Continuous Site Switching and My DomainEnabling MydomainSalesforce api.status.salesforce.com returns no data

How to prevent clipped screen edges on my TV, HDMI-connected?

How to respectfully refuse to assist co-workers with IT issues?

How do I prevent other wifi networks from showing up on my computer?

Why do banks “park” their money at the European Central Bank?

How to gently end involvement with an online community?

How much does Commander Data weigh?

Duplicate instruments in unison in an orchestra

"Sorry to bother you" in an email?

What is the difference between "Grippe" and "Männergrippe"?

How to know which loss function is suitable for image classification?

If an earthquake can destroy buildings why it cant kill us according to physics?

Can I get temporary health insurance while moving to the US?

Tex Quotes(UVa 272)

How do I make my image comply with the requirements of this photography competition?

Architectural feasibility of a tiered circular stone keep

Are there any elected officials in the U.S. who are not legislators, judges, or constitutional officers?

Can a Rogue PC teach an NPC to perform Sneak Attack?

What would make bones be of different colors?

Did anyone try to find the little box that held Professor Moriarty and his wife after the crash?

Was there ever a treaty between 2 entities with significantly different translations to the detriment of one party?

Prevent use of CNAME Record for Untrusted Domain

New Math Formula?

How do we calculate energy of food?

How do you harvest carrots in creative mode?



How to retreive domain name from salesforce org


Can I simply disable an automatically created identity provider?Can not log into org with 'My Domain' due to HSTSdomain name in our orgCan the My Domain feature support multiple domainsRisks of deploying My Domain before the upcoming instance refresh?How to get your Custom Domain Name if you have Mydomain enabled - using Apex?Continuous Site Switching and My DomainEnabling MydomainSalesforce api.status.salesforce.com returns no data






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















Select id,Domain from domain , this query does not return any records. I am trying to retrieve domain name in my salesforce org so that i can append it to that to any new user's username in salesforce at the time of creation.



Did anybody face this issue and if so , how did you overcome this?



Thanks,
Asha










share|improve this question






























    2















    Select id,Domain from domain , this query does not return any records. I am trying to retrieve domain name in my salesforce org so that i can append it to that to any new user's username in salesforce at the time of creation.



    Did anybody face this issue and if so , how did you overcome this?



    Thanks,
    Asha










    share|improve this question


























      2












      2








      2


      0






      Select id,Domain from domain , this query does not return any records. I am trying to retrieve domain name in my salesforce org so that i can append it to that to any new user's username in salesforce at the time of creation.



      Did anybody face this issue and if so , how did you overcome this?



      Thanks,
      Asha










      share|improve this question














      Select id,Domain from domain , this query does not return any records. I am trying to retrieve domain name in my salesforce org so that i can append it to that to any new user's username in salesforce at the time of creation.



      Did anybody face this issue and if so , how did you overcome this?



      Thanks,
      Asha







      mydomain






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 12 at 16:33









      AshaAsha

      111 bronze badge




      111 bronze badge























          1 Answer
          1






          active

          oldest

          votes


















          4















          Url.getSalesforceBaseUrl will return your "my domain" URL (e.g. https://mydomain.my.salesforce.com/), and you can get the Host from here:



          String myDomain = Url.getSalesforceBaseUrl().getHost();


          The Domain object is related to Site.com, which is not your intent.






          share|improve this answer



























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "459"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f273300%2fhow-to-retreive-domain-name-from-salesforce-org%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            4















            Url.getSalesforceBaseUrl will return your "my domain" URL (e.g. https://mydomain.my.salesforce.com/), and you can get the Host from here:



            String myDomain = Url.getSalesforceBaseUrl().getHost();


            The Domain object is related to Site.com, which is not your intent.






            share|improve this answer





























              4















              Url.getSalesforceBaseUrl will return your "my domain" URL (e.g. https://mydomain.my.salesforce.com/), and you can get the Host from here:



              String myDomain = Url.getSalesforceBaseUrl().getHost();


              The Domain object is related to Site.com, which is not your intent.






              share|improve this answer



























                4














                4










                4









                Url.getSalesforceBaseUrl will return your "my domain" URL (e.g. https://mydomain.my.salesforce.com/), and you can get the Host from here:



                String myDomain = Url.getSalesforceBaseUrl().getHost();


                The Domain object is related to Site.com, which is not your intent.






                share|improve this answer













                Url.getSalesforceBaseUrl will return your "my domain" URL (e.g. https://mydomain.my.salesforce.com/), and you can get the Host from here:



                String myDomain = Url.getSalesforceBaseUrl().getHost();


                The Domain object is related to Site.com, which is not your intent.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Aug 12 at 16:39









                sfdcfoxsfdcfox

                283k14 gold badges231 silver badges485 bronze badges




                283k14 gold badges231 silver badges485 bronze badges






























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Salesforce Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f273300%2fhow-to-retreive-domain-name-from-salesforce-org%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form