web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Issue in Confirmation Dialog Display

(0) ShareShare
ReportReport
Posted on by 135

Hello All,

I have an issue my Confirmation Dialog box has been shifted. Close button and question mark is coming in front as shown in the image below.

Could anyone please help me fix it

pastedimage1571370057829v1.png

Code:

function Decommission(selectedId) {
debugger;
var confirmStrings = { text: "Are you sure, You want to Decommission this TCU?", title: "Confirmation Dialog", confirmButtonLabel: "Yes", cancelButtonLabel: "No" };
var confirmOptions = { height: 200, width: 450 };
Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
function (success) {
});
}

Regards,

Hima

I have the same question (0)
  • cloflyMao Profile Picture
    25,210 on at

    Hi Hima,

    If element modalDialogView_1 or modalDialogContentContainer has attribute direction:rtl; then the direction of content will display as yours.

    pastedimage1571372826600v1.png

    You could check whether there is any customization included in custom solution which may has css rule to overwrite the default.

    Regards,

    Clofly

  • HimaM Profile Picture
    135 on at

    No Clofly. Its a JavaScript function i haven't used any CSS here.

  • cloflyMao Profile Picture
    25,210 on at

    Hi Hima,

    A not perfect workaround would be by creating a timer to wait for dialog opened, then change it direction attribute manually,

      var confirmStrings = { text: "Are you sure, You want to Decommission this TCU?", title: "Confirmation Dialog", confirmButtonLabel: "Yes", cancelButtonLabel: "No" };
      var confirmOptions = { height: 200, width: 450 };
      Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
        function(success) {
    
        });
    
      setTimeout(function(){ 
           var element = parent.document.getElementById("modalDialogContentContainer");
           element.style.direction = "rtl";
      }, 2000);

    as below I manually changed the direction as your issued dialog.

    pastedimage1571374770464v1.png 

    However, I recommend you could check in Styles tab in developer tool to see if there is any css rule which may changed the default direction,

    because by default all html element direction is ltr.

    If your env is op, then you could modify styles.css file directly.

    If env is online, then you may request a support ticket for help to completely solve the issue due to css files are not accessible for us.

    Or just clear browser cache as the previous thread said:

    https://community.dynamics.com/365/f/dynamics-365-general-forum/301946/xrm-navigation-openconfirmdialog-text-and-button-on-the-left-side?pifragment-94232=1

    Regards,

    Clofly 

  • HimaM Profile Picture
    135 on at

    Hi Clofly,

    I tried your code but it's not working as im still getting the same display.

    However, How do we raise a support ticket?

    Regards,

    Hima

  • cloflyMao Profile Picture
    25,210 on at

    Hi Hima,

    Because dialog is added dynamically, if there are many script web resouces(there is only one script resource on my form), the dialog completely loaded time will be influenced, that's why its not perfect, if time set to be longer, user would had not friendly experience.

    I just added a supplement in my last comment:

    You could try clear cache as there was user also encountered your issue.

    community.dynamics.com/.../xrm-navigation-openconfirmdialog-text-and-button-on-the-left-side

    Try it before finally open a ticket:

    admin.dynamics.com/

    Regards,

    Clofly

  • Suggested answer
    cloflyMao Profile Picture
    25,210 on at

    Hi Hima,

    You could try below code to change its direction, it will insert a css rule into html, thus the dialog will always be influenced with it,

    while the problem that there is time/wait for dialog to be loaded could be avoided if we works with js code to control style.

    I have tested multiple times and it works well.

    var cssRules = '#modalDialogContentContainer { direction: ltr!important; }';
    
    var styleElement = document.createElement('style');
    
    styleElement.appendChild(document.createTextNode(cssRules));
    
    parent.document.getElementsByTagName('head')[0].appendChild(styleElement);
    
    var confirmStrings = { text: "Are you sure, You want to Decommission this TCU?", title: "Confirmation Dialog", confirmButtonLabel: "Yes", cancelButtonLabel: "No" };
    var confirmOptions = { height: 200, width: 450 };
    Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
    function (success) {
    
    });

    That would up to you if you could still take code as workaround or wait for support ticket solution.

    And have you tried to clear cache ?

    Please let me know whether your issue has been solved successfully.

    I'm waiting for your reply, thanks.

    Regards,

    Clofly

  • HimaM Profile Picture
    135 on at

    Hi Clofly,

    I have cleared cache and tried but no luck.

    I followed what you suggested but i didn't get the expected result.

    This is a JS file.

    Im using this function on a entity home page button.

    function Decommission(selectedId) {

    debugger;

    var cssRules = '#modalDialogContentContainer { direction: ltr!important; }';

    var styleElement = document.createElement('style');

    styleElement.appendChild(document.createTextNode(cssRules));

    parent.document.getElementsByTagName('head')[0].appendChild(styleElement);

       var confirmStrings = { text: "Are you sure, You want to Decommission this TCU?", title: "Confirmation Dialog", confirmButtonLabel: "Yes", cancelButtonLabel: "No" };

       var confirmOptions = { height: 200, width: 450 };

       Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(

       function (success) {

       });

    }

    Regrds,

    Hima

  • cloflyMao Profile Picture
    25,210 on at

    Hi Hima,

    What your home grid means, would it be view such as related entity ?

    while I only tested it in formOnload event in web resource and form ribbon button.(My direction is set to rtl to test)

    pastedimage1571387890700v1.png

    Actually css style shall be applied to the element, and you can see the style tag has been appended to HTML document(click <style> tag to jump to).

    pastedimage1571388042062v2.png

    pastedimage1571388089797v3.png

    If the style element had not been appended to document, please try to:

    1. remove parent. (but I thought all our code should work on same layer as web resource javascript even if it's applied to grid button) 

    2. create a separate web resource with style tag appending function to make sure the style can be appended to body document.

    If your dialog direction is still reverse even if we applied our style to it, please share me a screenshot of issue.

    Regards,

    Clofly

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Hamza H Profile Picture

Hamza H 140 Super User 2026 Season 1

#2
Nagaraju_Matta Profile Picture

Nagaraju_Matta 128

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 70 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans