Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming TechTalks
I have alert js that opens html web resource with fetched table data. My fetch works with current record id, which I can't get inside html.
Here is my html :
var invoiceId = parent.window.Xrm.Page.data.entity.getId(); var fetchInv = '<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">'; fetchInv += '<entity name="hms_invoice">'; fetchInv += '<attribute name="hms_customer" />'; fetchInv += '<attribute name="hms_pricelist" />'; fetchInv += '<filter type="and">'; fetchInv += '<condition attribute="hms_invoiceid" operator="eq" value="'+invoiceId+'" />'; fetchInv += '</filter>'; fetchInv += '</entity>'; fetchInv += '</fetch>';
var invoices = XrmServiceToolkit.Soap.Fetch(fetchInv);
Neigther window.parent, nor window.top.opener.parent. , etc, does work.
Try with below syntax in case if your html page is not embedded with CRM(Popup window)
It should work
you can pass the GUID from the parent page when you are opening the web Resource as part of the data Xrm.Navigation.openWebResource(webResourceName,windowOptions,data)
You can pass the id through the query string. You have to choose the HTML web resource on the URL Command action and select true on the Pass Parameters.
Then you can get the record GUID from the querystring.
var recordId = $.urlParam("id");
this also doesn't work, I can't access because its alert.js
did you add this tag in the above of your script?
Yes I added Client Global and Fetch libraries
I found the answer.
The right solution is to use :
var crmWindow = parent.Alert.getCrmWindow();
var id = crmWindow.Xrm.Page.data.entity.getId();
This works also for getting other types of data.
Thanks for your suggestions!
this function is not supported and will not work in UCI (the new interface ) you should pass the value to web resource using Xrm.Navigation.openWebResource(webResourceName,windowOptions,data) or query string
Business Applications communities