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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Passing parameters and open HTML web resource

(0) ShareShare
ReportReport
Posted on by

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

var year=Xrm.Page.getAttribute("year").getValue();

var productTypeCode=Xrm.Page.getAttribute("producttypecode").getValue();

var accountId=Xrm.Page.getAttribute("accountid").getValue()[0].id

var priceListId=Xrm.Page.getAttribute("pricelistid").getValue()[0].id;



//var url= Xrm.Page.context.getClientUrl() + '/WebResources/productselector.html'

var url= Xrm.Page.context.getClientUrl() +'/WebResources/productselector.html?’+'accountplanid=’+ accountPlanId+'&year=’+year+’& producttypecode=’+ productTypeCode+’& accountid=’+ accountId+’& pricelistid=’+ priceListId

In above code I am passing the parameters to HTML web resources and forming the URL

.I am getting the all the fields values.but HTML page is not opening I guess some syntax error is there.

*This post is locked for comments

I have the same question (0)
  • anilambadan Profile Picture
    1,160 on at

    Have you used Xrm.Utility.openWebResource(webResourceName,webResourceData,width, height)

    to open html file?

    Please refer the following link

    https://msdn.microsoft.com/en-us/library/jj602956.aspx#BKMK_OpenWebResource

    thanks

    Anil

  • Community Member Profile Picture
    on at

    I am using window.open(url,'','height=500px,width=930px,resizable=0,status=0,scroll=0;toolbar=0,menubar=0,location=0');

    From  Silverlight application i need to access the html webresource page parameters

    some syntax error in my URL forming.

  • anilambadan Profile Picture
    1,160 on at

    Please try to use

    var url= Xrm.Page.context.getClientUrl() +'/WebResources/productselector.html?accountplanid=’+ accountPlanId +'&year=’ + year + ’&producttypecode=’ + productTypeCode +’&accountid=’+ accountId+’&pricelistid=’+ priceListId

    i think there was some formatting issues.

  • Community Member Profile Picture
    on at

    Not working.

  • anilambadan Profile Picture
    1,160 on at

    Try to remove all parameters and see whether its opening the url or not. if its opening try to add parameters one by one and  try to findout the issue

  • Community Member Profile Picture
    on at

    with out patameters it is opening

    var url= Xrm.Page.context.getClientUrl() + '/WebResources/productselector.html'

    Not opening if has parameters

    var url= Xrm.Page.context.getClientUrl() +'/WebResources/productselector.html?accountplanid=’+accountPlanId

  • anilambadan Profile Picture
    1,160 on at

    can you try to open the html file using

    var customParameters = encodeURIComponent("first=First Value&second=Second Value&third=Third Value");

    Xrm.Utility.openWebResource("new_webResource.htm",customParameters);

  • Suggested answer
    MilindP Profile Picture
    1,019 on at

    Try using

    ar url= Xrm.Page.context.getClientUrl() +'/WebResources/productselector.html?data=accountplanid=’+ accountPlanId +'&year=’ + year + ’&producttypecode=’ + productTypeCode +’&accountid=’+ accountId+’&pricelistid=’+ priceListId

    please notice after URL, using "data=<parameters>" and then extract the parameters in web resource

    see this https://msdn.microsoft.com/en-us/library/gg327945.aspx 

  • Community Member Profile Picture
    on at

    It is opening but non responsive error dialog coming .

    while debugging script customParameters

    var customParameters = encodeURIComponent("accountplanid=accountPlanId&year=year&producttypecode=productTypeCode&accountid=accountId&pricelistid=priceListId")

    customParameters variable values is coming as  below

    accountplanid%3DaccountPlanId%26year%3Dyear%26producttypecode%3DproductTypeCode%26accountid%3DaccountId%26pricelistid%3DpriceListId

  • Community Member Profile Picture
    on at

    It is opening but non responsive error dialog coming .

    while debugging script customParameters

    var customParameters = encodeURIComponent("accountplanid=accountPlanId&year=year&producttypecode=productTypeCode&accountid=accountId&pricelistid=priceListId")

    customParameters variable values is coming as  below

    accountplanid%3DaccountPlanId%26year%3Dyear%26producttypecode%3DproductTypeCode%26accountid%3DaccountId%26pricelistid%3DpriceListId

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans