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)

connecting to CRM Server through html page for fetching related Contacts of an Account and editing Contact records through html page

(1) ShareShare
ReportReport
Posted on by 161

Hi Experts,

I have a requirement of Creating one standalone html page and it has some structure like this below

table.png

so when we enter account number it has to display all the related contact records then when we select record that row has to become editable like saving and deleting existing record and creating new one.

so please tell me how can i approach to solve this requirement it's very urgent.

some list of doubts

1.how we can we connect to CRM server and fetch records with out adding html file   as webresource in above case.

2.how can we synchronize the edited records with CRM database?

3. how can we know which record the user is going to edit when we submit save button so that we can update that particular record with guid?

*This post is locked for comments

I have the same question (0)
  • Mahendar Pal Profile Picture
    45,095 on at

    Hello,

    1.how we can we connect to CRM server and fetch records with out adding html file   as webresource in above case.

    - You can use Microsoft CRM Web API, but this in beta version, (msdn.microsoft.com/.../webapipreview.aspx)

    2.how can we synchronize the edited records with CRM database?  - Use the same above

    3. how can we know which record the user is going to edit when we submit save button so that we can update that particular record with guid?

    - You need to keep one hidden column which will store guid of the records displayed in the grid, so that when user will select the row you can get guid based on the selected index.

  • Nagaraj M Profile Picture
    161 on at

    thanks for the response

    i have one more doubt i.e with out embedding an html screen inside entity can we able to open it in separate screen?

  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at

    Yes, (assuming you want to open it in CRM may be from button click) you can open it like a dialog, you can use Xrm.Utility like below,

    Xrm.Utility.openWebResource(webResourceName,webResourceData,width, height)

  • Nagaraj M Profile Picture
    161 on at

    which library file do i need to add for using that function? can u explain what's WebResourceData means here? if possilbe please provide any link for exploring

  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at

    No need to use any library it is part of CRM scripting, you can just pass web resource name, other parameters are not required, please refer below for more details.

    msdn.microsoft.com/.../jj602956.aspx

  • Nagaraj M Profile Picture
    161 on at

    Hi,

    I have created one html webresource in this i am fetching related contacts of Account and displaying it in one grid but even though i have added reference of SDK.REST.js file in the html it's unable to find the RetrieveMutilpleRecords functions.

    <script src="../WebResources/new_SDK.REST.js" type="text/javascript"></script>

    location of webresource in solution is lntlnt.crm5.dynamics.com/.../new_SDK.REST

    iam calling function as  new_SDK.REST.retrieveMultipleRecords and i have tried by removing new_ also what might be the issue please suggest the solution

  • Mahendar Pal Profile Picture
    45,095 on at

    It seems to be a resource path issue, create your resource name like this:

    "/SDK.Rest" so it should be new_/SDK.Rest.js with prefix, make sure your html web resource is added with the same way, after then you should be able to access like using below reference

    <script src="../new_/SDK.REST.js" type="text/javascript"></script>

  • Nagaraj M Profile Picture
    161 on at

    hi,

    I have added the web resource name as you said

    now it's location in solution is

    lntlnt.crm5.dynamics.com/.../SDK.REST

    and the html file location is

    lntlnt.crm5.dynamics.com/.../new_retrieveRelatedContacts

    iam referencing the sdk.rest file as

    <script src="..new_/SDK.REST" type="text/javascript"></script>

    i tried below also

    <script src="..WebResources/new_/SDK.REST" type="text/javascript"></script>

    iam calling retrieve function as

    SDK.REST.retrieveMultipleRecords

    i added new_/ prefix also but still it's not going to that function . what might be the issue.?

  • Mahendar Pal Profile Picture
    45,095 on at

    Your html web resource is not in format of new_/name, make it similar to rest one as I said before.

    Refer: msdn.microsoft.com/.../gg309536.aspx

  • Nagaraj M Profile Picture
    161 on at

    thanks now it's able to locate the reference file but when i am retrieving all related contacts of an account record  i am placing this command Xrm.Page.data.entity.getId().replace("{", "").replace("}", "") + "'";  in html page but it's saying Xrm is not defined. so how can i get related contacts of particular account ?

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 April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans