Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Jquery is not working on powerapps portal.

Posted on by 5

Hi All,

Issue: in powerapps Portal jquery is not working.(unable to get web role of logged in user)

i am facing issue with jquery, where in a function i want to take the user's current logged in web role.

i have written function which works fine in DEV but doesen't work in SIT environment after deployment.

I have checked all code and related files, web pages, permissions are fine,

Even when i put a debugger; the debugger doesen't show any code after stopping at debugger.

A code in DEV works perfectly fine to get the user's current role the only problem is with SIT

I am still learning portal, so even basic answers also appreciated.

Please find below code which is working perfect in DEV environment.

$(document).ready(function() {
debugger;
// Get Loggedin user name and Loggedin user account name
var user = "{{ user.fullname }}";
var account = "{{ user.parentcustomerid.name }}";

Thanks,

Tejas.

  • Suggested answer
    Tejas K Profile Picture
    Tejas K 5 on at
    RE: Jquery is not working on powerapps portal.

    Thanks for your early responses. :)

    This issue has been resolved now.

    Actually on Portal what I have noticed is,

    If contact configuration is not done in correct way then it could cause this issue.

    How I solved:

                         1: Deleted and recreated the contact in Portal Management app.

                         2: Configured my contact with Invitation redemption in various ways and checked the duplicate email has not been created while redeeming invitation code.

                         3: After login validated and it started working fine.

  • Suggested answer
    Akhil101 Profile Picture
    Akhil101 432 on at
    RE: Jquery is not working on powerapps portal.

    Check if your custom JS is added under Localized content of your web page. Open the record -> go to Advanced -> add your Custom JS there. See if it works!!

    pastedimage1617797538645v1.png

    Regards,

    AKHIL

  • Suggested answer
    Inogic Profile Picture
    Inogic 24,094 on at
    RE: Jquery is not working on powerapps portal.

    Hi Tejas,

    Please try the below steps and let us know if it works for you:
     

    1.      Sign-In to portal with the contact, which should have “Administrator” web role associated with him.

     

    2.       Use below code on web page/ entity form:

     
    $(document).ready(function() {
    debugger;
    var customMessage=”Check debugger”;
    alert(customMessage);
    });
     

    3.      Clear cache of portal:

     
    <<Portal URL>>/_services/about
     

    4.      If above code works then you can try below code, after signing to portal:

     
    $(document).ready(function() {
    debugger;
    // Get Loggedin user name and Loggedin user account name
    var user = "{{ user.fullname }}";
    var account = "{{ user.parentcustomerid.name }}";
    });
     

    5.      Clear cache portal:

     
    <<Portal URL>>/_services/about
     

    6.      Refresh the page and check if the code is debugging:

    Hope this helps!

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

Featured topics

Product updates

Dynamics 365 release plans