Hi Experts,
I'm trying to add custom behavior in one of my portal pages and I added my javascript but I can't make it work. I'm now trying to do something even more basic such as an alert but I still can't make it work, does anyone have a clue about it?
I already cleared the cache, tried in different browsers but nothing, any help is welcome thanks
Hi @Eoin_citizien ,
Is the solution I provided above helpful in your scenario?
If the solution I provided above is also helpful in your scenario, please also consider go ahead to click "Accept as Solution" to identify my reply as helpful.
For your issue, I have made a test on my side, and the issue is confirmed on my side. The custom JavaScript code would not work in Web page "Advanced tab", instead, you need to go to the corresponding "Localized content" Advanced tab, then specify your JS code there.
Actually, the content of a Web Page in PowerApps Portal is based on the corresponding "Localized content". If you want to made some customization changes (e.g. Page Layout, CSS Style, ...) to your Web page, you should made changes to the corresponding Content page.
I would also post this issue to my Product Team, if the issue is fixed, I would reply here.
Regards,
yeah it is a bit confusing but just keep in my mind that whatever relates to content you should work on the localized/content web page
there is just no logic hiding that field for the root web page.. it is also two different forms for root/content page, so if you want you can even remove from the root web page form
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Thank you it's working now I was adding the javascript in the wrong place.
But if the custom javascript that "works" is within the localized content page why there is even a "custom javscript" in the main web page?
Hi @Eoin_citizien ,
Could you please share a bit more about your scenario?
Do you want to add a custom JavaScript in your web page?
Based on the JavaScript code that you mentioned, I think there may have something wrong with it. Please consider try the following JS code:
$(document).ready(function(){
window.alert('Alert Info......')
})
then go to your Portal Designer, then click "Sync Configuration"-> "Browser website", to make the changes you made in your Portal Management take effect.
If the issue still exists, please consider take a try with @the365bit 's solution, open the Localized content of your Web page in your Portal Management:
then switch to "Advanced" tab in the opening Content page, then type above JS code inside the JavaScript section part, then click "Save" button. Then go to Portal Designer, click "Sync Configuration"-> "Browser website" to update your Portal changes.
Please try above solution, hopes it could solve your problem.
Best regards,
Hi @Eoin_citizien ,
You are probably adding the javascript in the Web Page main record instead of the localized content page,
Open your web page, scroll down to localized content subgrid and open the listed record, then go to Advanced and custom javascript.
You can see that the following screenshot only has 5 tabs available, General, Advanced, Administration, Notes and Related. The screen shot that you send even though it's cut I can see many more tabs hence you most likely are editing the wrong record.
WarrenBelz
146,731
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,075
Most Valuable Professional