web
You’re offline. This is a read only version of the page.
close
Skip to main content
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,510

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    MilindP Profile Picture
    1,019 on at
    RE: how to get entity record urls dynamically

    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,510 on at
    RE: how to get entity record urls dynamically

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

  • Verified answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at
    RE: how to get entity record urls dynamically

    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
    RE: how to get entity record urls dynamically

    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
    RE: how to get entity record urls dynamically

    Thanks man.....this helped me

  • Suggested answer
    Vipin J Profile Picture
    1,603 on at
    RE: how to get entity record urls dynamically

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans