Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

XrmToolbox: Get current connection in custom plugin

(0) ShareShare
ReportReport
Posted on by 20

Hi everybody,

I try to generate a dynamic Link to a record. Have anybody an Idea how can I get the url of the current connection in my plugin?

Thanks for all.

  • Tiras2810 Profile Picture
    Tiras2810 20 on at
    RE: XrmToolbox: Get current connection in custom plugin

    Hi all,

    it is not a normal Plugin. It is a winforms app which dll you can add for use to XrmToolbox. If you create a c# Project you need to select XrmToolbox Extension. There are only an IOrganizationService Object available.

    What I need is the connection to the instance to which you connected as you opened the XrmToolBox Plugin. I don´t know how can I get it. In AppData Folder there are all connections stored in xml file what you have created but I can´t use it because I don´t know about current connection.

    Any other idea?

    Thanks all

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,961 Moderator on at
    RE: XrmToolbox: Get current connection in custom plugin

    Hi,

    I don't think you will be able to get the current connection OOB.

    You could configure below string in CRM Dynamics or pass string as unsecure configuration in plugin steps.

    CRMORG.crm.dynamics.com/main.aspx

    Now in custom plugin you can fetch the data if you use unsecure config then from constructor and if you are storing it in some configuration entity then use query exression to get that.

    Once you get the string you need to replace ENTITYNAME with context.PrimaryEntityId entity name and ENTITYRECORDID with context.PrimaryEntityName

    For each environment you will need to update the configuration or unsecure conifguration plugin steps with correct URL.

    If found helpful, Please mark my answer verified.

  • Suggested answer
    sdfasdf Profile Picture
    sdfasdf 840 on at
    RE: XrmToolbox: Get current connection in custom plugin

    Hello,

    I don't think you'll be able to determine the organization URL from the context of custom plug-ins, unfortunately. There is however a solution you might want to try, which is to use the Secure and Unsecure Configuration, which are strings passed to the custom plug-in's contructor. You may want to provide the organization URL via those parameters. Please refer to this article: docs.microsoft.com/.../write-plug-in

    I hope this is helpful to you ;)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans