Hide Web Page After Login the Portal.

Hello folks, Sometime in D365 portal, we have the requirement to hide web page after login mean web page can access only by the anonymous user and after login the portal, web page is not visible to the user.
As you can see in below snapshot, Before login, page is visible
but after login page is not visible.

This kind of requirement can be achieved through code using js. Here i am assuming you have created your web page in the portal.
Now follow the below steps to achieve this requirement.

Step 1:  Go to Portal > Web Template in CRM. Open Header Web Template.


Step 2: Copy the below code and change the name of a web page which you want to hide

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
var userEmail = '{{user.emailaddress1}}' ;
// Here my web page name is Register.
if (userEmail)
{
$('a:contains("NAME_OF_WEB_PAGE")').parent().next().hide();
 $('a:contains("NAME_OF_WEB_PAGE")').hide();
}
else
{
 $('a:contains("NAME_OF_WEB_PAGE")').parent().next().show();
 $('a:contains("NAME_OF_WEB_PAGE")').show();
}
</script>

Step 3: Paste this code at the end of Header Web Template code.



Now check your portal. It's working.

Hope this article helps you!


If you want to hide page for the anonymous user and visible for an authenticated user then Click Here to know that.

6 comments:

Sam William said...

Enjoyed reading the article above , really explains everything in detail,the article is very interesting and effective.Thank you and good luck for the upcoming articles, For Microsoft Dynamics 365 services contact Dynamics Square.

OutrightStore said...

Nice Blog,Keep updates
I think it’s awesome,someone share these kind of knowledge.Keep it up
You can also check Global Hide Manager for more related information.

CRMJetty said...

Going through your Blog.

Enjoyed that someone share his knowledge of Dynamic CRM Portal.

Indeed very useful.

Thanks Again.

Anu Priya said...

This is informative blog post!!!!!
Consumer Affinity
Dealer Sales in Mumbai
Neighborhood Profile in Delhi
Media Mix in Mumbai

Unknown said...

Thank you so it worked. And I solve my problem.

Tasneem Abdul Raheem said...

Thank you so it worked. And I solve my problem.
This Blog always helpful for me.