Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Create Dynamic URL for Records

(0) ShareShare
ReportReport
Posted on by

Hi All ,

Can anyone help me to create opt out URL's for contacts with their user id?

*This post is locked for comments

  • RE: Create Dynamic URL for Records

    Thanks it worked for me

  • Verified answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: Create Dynamic URL for Records

    Check this : docs.microsoft.com/.../open-forms-views-dialogs-reports-url

  • Verified answer
    RE: Create Dynamic URL for Records

    Hi Rajasimha ,

    you could use the following functions:

    // GetCurrentEntityPage()
    function GetCurrentEntityPage() { 
        var org = Xrm.Page.context.getClientUrl();
        var entitycode = Xrm.Page.context.getQueryStringParameters().etc;
        var entityid = encodeURIComponent(Xrm.Page.data.entity.getId());
        return 'https://' + org + '/main.aspx?pagetype=entityrecord&etc=' + entitycode + '&id=' + entityid;
    }
    // GetEntityPage(2, contactid);
    function GetEntityPage(entitycode, entityid) {
        var org = Xrm.Page.context.getClientUrl();
        entityid = encodeURIComponent(entityid);
        return 'https://' + org + '/main.aspx?pagetype=entityrecord&etc=' + entitycode + '&id=' + entityid;
    }

    Please let me know if you solve.

    If you found the answer helpful, please mark as Verified 

    Join my network on LinkedIn Follow me on Twitter 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna+Milano, ITALY

    Independent Contractor

    http://www.francescopicchi.com

  • Verified answer
    Syed Ibrahim Profile Picture
    Syed Ibrahim 6,257 on at
    RE: Create Dynamic URL for Records

    Hi Raja,

    Pls use the below code.

    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";

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