31
Views
2
Comments
Screen.orientation.lock('portrait'); is not working.

I am running a javascript screen.orientation.lock('portrait'); OnDestroy action of a screen, but it doesnt seem to work.

I tried to run it on a buttonclick also, it doesnt seem to work either.

How do I fix it? Has it changed?


2026-02-26 06-29-24
Rahul
 
MVP

Hi Amol,

follow this post with solution

https://www.outsystems.com/forums/discussion/45410/mobile-screen-orientation-lock-in-version-11/


Try in extensibility configurations:


{
"preferences": {
"global": [
{
"name": "orientation",
"value": "portrait"
}
]
}
}


To test, you need install a new build.


Hope this will help you.

Regards

Rahul

UserImage.jpg
Amol Rane

I want it to work only for one screen, not the entire app.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.