Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Populate Email as Username in CRM Portal Registration page

(0) ShareShare
ReportReport
Posted on by 50

Hi,

I am trying to populate user's email (read only) as username in the portal registration page. I tried the HTML code

<script>
$(document).ready(function () {
var email = $('#ContentContainer_MainContent_MainContent_EmailTextBox').val();
$('#ContentContainer_MainContent_MainContent_UsernameTextBox').val(email);
$("#ContentContainer_MainContent_MainContent_UsernameTextBox").attr('readonly', 'readonly');
$("#ContentContainer_MainContent_MainContent_ShowEmail").hide();

});

</script>
but it's not working.
Am I doing anything wrong?
Thanks
  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Populate Email as Username in CRM Portal Registration page

    Hi Partner,

    Are you trying to auto-populate the username field with email value when you register in the portal?

    pastedimage1659681983082v1.png

    To enable or disables an email address field instead of a username field. Add following line in the Portal Settings and set the value to true.

    Authentication/Registration/LocalLoginByEmail

    https://docs.microsoft.com/en-us/power-apps/maker/portals/configure/set-authentication-identity#enable-aspnet-identity-authentication 

    Dynamics 365 Portals - Force email as username - FlexRM

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans