Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

ADX STUDIO - Set the default Homepage for specific portal user

Posted on by Microsoft Employee


I have two kind of user in my portal, a customer user and an agent user. I want to change the default Homepage of Agent user every time he/she logs in or clicks to a Homepage button to the website instead of the customer's default homepage.ie (Agent Homepage) Currently, I was able to achieve this through below code:

    var userId = AuthenticationManager.AuthenticationResponseGrant.Identity.GetUserId(); var user = await UserManager.FindByIdAsync(userId);

    var portal = PortalCrmConfigurationManager.CreatePortalContext();
    var usercontext = portal.User;
    var context = portal.ServiceContext;
    var contact = (from c in context.CreateQuery("contact")
                   where c["contactid"].Equals(userId)
                   select c).First();
    var isAgentUser = contact.GetAttributeValue<bool>("bh_isagentuser");



   if (isAgentUser == true)
   {
       return Redirect("/agent-home");
   }
   else
   {
      return RedirectToLocal(returnUrl);
   }


I want to know if there's another workaround for ADX studio to achieve this?

*This post is locked for comments

  • Suggested answer
    Jharana Baliyar Singh Profile Picture
    Jharana Baliyar Singh 2,665 on at
    RE: ADX STUDIO - Set the default Homepage for specific portal user

    Hi Ruzel,

    Yes we can do by setting site marker profile->Page u can select Home instead of Profile. Otherwise in Profile web page Advanced section javascript u can put : window.location = "/url".

    Thanks,

    Jharana

  • OrchidC Profile Picture
    OrchidC 200 on at
    RE: ADX STUDIO - Set the default Homepage for specific portal user

    Hi adx users, any idea how we can achieve this without overriding the code behind?

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans