Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM365 Jscript get Value from Field in Quick View on Related Entity

(0) ShareShare
ReportReport
Posted on by

Hi--

I'm trying the get the Value of Field, that's located in a QuickView on a Related Entity.

I know how to get the value if it's on the same form; and I know how to get the value of a 'normal' field on a related entity; ...but I can't get the two working together.

Example--

To get the value out of a QuickView I'd use this:

var quickViewControl = Xrm.Page.ui.quickForms.get("RelatedCaseInformation");
var jobnumberField = quickViewControl.getControl(1).getAttribute("gs_jobnumber").getValue();


 To get value from a Related Entity, I'm using (as an example):

var poField = Xrm.Page.getAttribute("msdyn_purchaseorder").getValue();

	if (poField != null && poField != undefined) {
		// get id
		var poFieldId = poField[0].id;
		var poFieldId = poFieldId.replace('{', '').replace('}', '');
		var poFieldEntity = poField[0].entityType;
		var columns = ['gs_Case'];
		var poFieldRecord = gs_CrmRestKit.Retrieve(poFieldEntity, poFieldId, columns, null);
		
		var Caseno = poFieldRecord.gs_Case;
	}


Any ideas how I can use the latter code to get to the Value of Field in QuickView on a Related Entity?
Maybe something like this (though I've tried and it didn't work):

var poFieldRecord.quickForms.get("RelatedCaseInformation");


 Thanks in advance for any suggestions!

*This post is locked for comments

  • RE: CRM365 Jscript get Value from Field in Quick View on Related Entity

    I eventually went with Guillaume's suggestion.

  • Suggested answer
    gdas Profile Picture
    gdas 50,089 Moderator on at
    RE: CRM365 Jscript get Value from Field in Quick View on Related Entity

    Hi Pete ,

    Could you please try below code . You can enable the debugger and check what you are getting in poField object.

    var poField = Xrm.Page.getControl('manufactureQuickView_manufactureQuickView_new_manufacture_new_Country'); //Replace the id
    		if (poField != null && poField != undefined) {
    			var id= poField.getValue()[0].id;
    			var name= poField.getValue()[0].name;
    		}
    
    
    		


  • RE: CRM365 Jscript get Value from Field in Quick View on Related Entity

    Hi Goutam,

    yes thanks. My requirement is a little different though. Basically I need to get to the value on a grandparent record; either via a quickview that exists on the parent, or via a lookup field on the parent.  I can get to the parent fine, but from there I struggle to get to the grandparent.

    thanks,

    pete.

  • Suggested answer
    gdas Profile Picture
    gdas 50,089 Moderator on at
    RE: CRM365 Jscript get Value from Field in Quick View on Related Entity

    Hi Pete,

    I believe you have  checked the url I have shared?

  • RE: CRM365 Jscript get Value from Field in Quick View on Related Entity

    Hi Guillaume,

    thanks for your quick reply.  Could you give me an example of how to do that 2nd retrieve? I'm trying to get the value/id from but I can't get the syntax right, and I seem unable to find it online.

    I would expect something like :

    var Caseno = poFieldRecord.gs_Case;
    Caseno.getValue()[0].id;


     ...but that's not working for me. Any tips would be hugely appreciated!

  • Suggested answer
    gdas Profile Picture
    gdas 50,089 Moderator on at
    RE: CRM365 Jscript get Value from Field in Quick View on Related Entity

    Hi ,

    Please find the reference below

    community.dynamics.com/.../access-quick-view-form-values-in-javascript

    Hope this helps.

  • Verified answer
    RE: CRM365 Jscript get Value from Field in Quick View on Related Entity

    Hi,

    I wouldn't try to do it your way but rather do it like that:

    1. get the ID of the related Entity

    2. create a webapi Retrieve call to get the 2nd related record ID(as you have a quick view on the 1st related entity you should have a relationship between the 1st and the 2nd related entity) with CRM rest Builder: github.com/.../CRMRESTBuilder

    3. create a 2nd webapi Retrieve cal to get finally the desired values even those which are not on the quick view form :)

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