web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

how to get entity record urls dynamically

(1) ShareShare
ReportReport
Posted on by 2,512

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    MilindP Profile Picture
    1,019 on at

    To generate the record url for opening the record in default form, you do need ObjectTypeCode and GUID of the record

    The URL can be generated as below....... Replace the variable values with your values

    On-Premise

    https://<domainname>/<orgname>/main.aspx?etc=<objecttypecode>&id=%7b<EntityRecordID>%7d&pagetype=entityrecord

    Online

    https://<orgname>.crm.dynamics.com/main.aspx?etc=<objecttypecode>&id=%7b<EntityRecordID>%7d&pagetype=entityrecord

  • sdnd2000 Profile Picture
    2,512 on at

    I understand, but from the external, how can I have the entityrecordID?

  • Verified answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at

    You can use JavaScript:

    Please follow this link to obtain the objecttypecode for the entity of current form

    //Get the object type code from the entity name

    https://community.dynamics.com/crm/f/117/t/189234

    ==============================================

    var orgURL = Xrm.Page.context.getClientUrl();;
    var recordId = Xrm.Page.data.entity.getId().replace("{", "").replace("}", "");
    var entityName = Xrm.Page.data.entity.getEntityName();
    
    //Get the object type code dynamically following the above url
    var objectTypeCode = 1; //for account entity
    
    var recordURL = "https://" + orgURL  + "/main.aspx?etc=" + objectTypeCode +
    "&id=%7b" + recordId + "%7d&pagetype=entityrecord";
    
  • Suggested answer
    Soroosh Profile Picture
    10 on at

    Hi,

    This is my recommendation for MS CRM 2016:

    1. Add a custom "Single Line of Text" field with "URL" format on your form.
    2. Create a custom workflow and enable the "Start when record is created".
    3. Add a step to update created field value with "Record URL (Dynamic)".
  • amity Profile Picture
    202 on at

    Thanks man.....this helped me

  • Suggested answer
    Vipin J Profile Picture
    1,603 on at

    You can get a Entity Record Url

    executionContext.getFormContext().getUrl();

    Here is a generalized method to open get entity record url based on Classic or UCI type

    https://vjcity.blogspot.com/2020/05/how-to-get-entity-record-url-in-dynamic.html

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans