Personalized Community is here!
Quickly customize your community to find the content you seek.
Check out the latest Sales updates!Learn about the key capabilities and features of Dynamics 365 Sales and experience some of the new features.
Download overview guide | Watch Sales video
2022 Release Wave 1 PlanDynamics 365 release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.
2022 release wave 1 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
I have successfully created a Web Resource in our Sales Trial which displays an external web page on the Account screen.
When calling the web resource I need to pass a variable so a query can be run on the page and the correct data returned.
EG pass account code which will be looked up in our database, the returning data will be displayed on the page and shown in the Account screen.
Am I using the correct terminology? and what methods are available to achieve this please?
Could I pass the parameter in the URL? If so how to dynamically add the parameter?
This article references the Custom Data Parameter column in the web resource dialogue, but where is that located?
Sample: Pass multiple values to a web resource through the data parameter (model-driven apps) - Power Apps | Microsoft Docs
Most grateful for your assistance.
How do you call the web resource, type address in the bowser or open it with Client API?
Hi Steve - thanks for your reply
I've inserted a web resource onto the form and successfully called an external html page which is great. I need to pass the account name for example when calling the external page. I've just discovered if I double click on the form in the editor I get the below image:
I've ticked the box to pass identifiers as parameters. I now need to check to see what is being passed and display it back to prove that I'm receiving them on the external html page. Any pointers to achieve that?
A quick question: Where are your account name from? Is it a static value or it comes from the Account entity's form of the CRM?
Yes I'd like to take the account name or another field from the account entities form and pass it in the URL. Is that possible?
I've managed to pass some static variables in the URL this morning. Now I need to figure out how to pass a variable, like the account name or some other value.
You can get form context in the web resource, and then get your account name from the Account's from. Please refer to this blog:
Hi Steve - great link. Some very helpful content there.
I dont think this helps me achieve what I need in this instance, but perhaps I've misunderstood.
What I need to do is somehow pass a parameter along with the call to the external web resource EG
The account code will then be looked up in our database and our page loaded into a form on the account page.
Does that seem feasible?
If it is not possible to pass a parameter along with the call to the external web resource, is it possible to define the parameter using one web resource, then create an action to call the external web resource using that defined parameter?
EG, look up the account name "ABC123", use script "callExternalWebResource.js" to call another web resource "mysite.com/externalWebResource.html"
Please try this:
1. Get the account name from the Account's form in your html type web resource, as shown in previous blogs.
2. Then send ajax request with your URL www.mywebsite.com/?accountName=[account name got from step1] in your web resource. Reference: Access external web service using HTML Web Resource - Microsoft Dynamics CRM Forum Community Forum
3. Finally get the data returned from ajax request and add it your web resource.
I think you are correct that it requires an Ajax request as currently the web page doesn't actually appear until the page is reloaded.
In case it helps anyone else this is the code I used:
var myVarName = formContext.getAttribute("requiredFieldName").getValue();
var url = "www.example.com/?data=" + myVarName;
var tag = document.createElement("object");
tag.setAttribute( "type", "text/html");
tag.setAttribute( "data", url );
tag.setAttribute( "width", "600px");
tag.setAttribute( "height", "600px");
console.log( tag );
document.body.appendChild( tag );
The key was formContext.getAttribute to get the table field required from the form.
Business Applications communities