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

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

                    Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                    Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?