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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Issue with opening CRM form via URL

(0) ShareShare
ReportReport
Posted on by 4,930

Hi,

I am trying to open a new entity form via an URL (via a button embedded in a webresource).

This is a part of my code:

 

var depotId = Xrm.Page.data.entity.getId();

var NumDepot = Xrm.Page.getAttribute("pb_num_depot").getValue();

var berichtURL = crm_url + "/main.aspx?etc=10024&extraqs=%26regardingobjectid%3d%257b" + depotId + "%257d%26regardingobjectidname%3d" + NumDepot + "%26regardingobjecttypecode%3dpb_depot&pagetype=entityrecord"

window.open(berichtURL);

Unfortunately the entity Id (var depotId) always contains { at the beginning and } at the end, so the URL can't be opened, since it would only expect the GUID without these special characters.

 

I already tried to append a string.replace like depotId.replace('{', '') or depotId.replace(/[{}]/g, ''), but this also didn't replace the {}

 

Any tip for me, how I will only get the GUID without {}?

 

thx a lot

Thomas

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    I recommend you to use Xrm.Utility.openEntityForm msdn.microsoft.com/.../gg334375.aspx

  • Suggested answer
    Community Member Profile Picture
    on at

    And yeah, you are using incorrect url. Look at part %3d%257b. Try to remove 25 from it. Same for %257d

    Look at example: /main.aspx?etn=lead&pagetype=entityrecord&extraqs=ownerid%3D%7bB8C6E040-656E-DF11-B414-00155DB1891A%7d%26owneridname%3DMark%20Folkerts%26owneridtype%3Dsystemuser

    (msdn.microsoft.com/.../gg334375.aspx)

    So basically, replace('{', '') works good, just change url.

  • tpeschat Profile Picture
    4,930 on at

    Xrm.Utility.openEntityForm works like charm.

    Thx Thomas

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans