Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to show Web Resource in Portal

Posted on by 5

Hi,

We've developed a custom solution which includes web resources. The web resources include custom js/css to render custom entities. Now Client wants to share the custom entity via CRM Portal and would like to use the same web resource rendering in Portal. 

So far this is what we've tried without any success:

  1. Created a custom entity form where we've embedded our web resource which is working fine in CRM Sales module.
  2. Exposed the custom entity form via Portal. But not rendering properly as the references to css/js files are missing in portal.

Can anyone please suggest if it's possible or best practices around using custom web resources (with css/js referencces in it) in CRM Portal?

Thanks

Sohel

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to show Web Resource in Portal

    You can't access webresources of CRM in Dynamics portal. You need to create new webfiles and access it in your webpages.

    docs.microsoft.com/.../web-files

    https://community.dynamics.com/crm/b/briteglobalsolutions/archive/2018/05/02/javascript-web-files-in-crm-portals

  • Sohel Rana Profile Picture
    Sohel Rana 5 on at
    RE: How to show Web Resource in Portal

    Hi Arpit,

    Thanks for your reply. We are using regular css/js reference like <Script Src="a.js" />. What I've found the <head> section of the web resource doesn't get rendered at all, where some of our js/css references are included. Also can you please elaborate a bit on "CRM web resource does support on portal unless any XRM script being written in the code". By 'code' do you mean server side code?

    we are using angularjs and dynamic loading of scripts (using typescript module loader) which all work fine inside CRM but not working in protal as the referenced css/js files not found in portal.

    Basically I'm looking for any guidelines or official documentation on how to use web resources in portal. If you can please guide me to any sample on github or Microsoft documentation on developing web resources for portal, that'll be great.

    Thanks

    Sohel

  • Suggested answer
    Arpit Shrivastava Profile Picture
    Arpit Shrivastava 7,518 User Group Leader on at
    RE: How to show Web Resource in Portal

    Hi Sohel,

    CRM web resource does support on portal unless any XRM script being written in the code. It also depends on what type of CSS/JS you are referring in the code, try putting it in web file and refer it in your custom javascript. Like below:

    $.getScript("~/myJS.js", function() {

     //your portal code.

    });

    Hope it helps.

    Mark the answer Verified if it helps.

    Regards

    Arpit

    arpitmscrmhunt.blogspot.com

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans