If you add a lot of text to a `dialog.create` mess...
# suitescript
e
If you add a lot of text to a
dialog.create
message when there are buttons, the buttons are pushed out of the viewable area, and that area isn't scrollable so you can't click the buttons. I can likely do a DOM hack to fix this, but wanted to make sure I wasn't missing something
n
First off: lol But yeah I think you are stuck with the DOM edits or using a library like SweetAlert2 Another fun quirk. The dialog.create() function doesn’t work on the project (job) record with custom buttons. No matter what you put in the buttons parameter it always just shows an “ok” and “cancel” button
👍🏻 1
*I haven’t tested that on 2024.2 so it may be fixed
e
I recall another issue with those "new UI" pages (like Project / Inbound Shipments, etc) Where you can add a banner message, but the banner message doesn't support HTML like it does on the "classic UI" pages (like Sales Orders, Invoices, etc)
👍 1
In case anyone else needs this...
Copy code
const message = `
<p id="dialog-pop-up-p">Whatever your pop up says goes here</p>
<script>
    const pElement = document.getElementById('dialog-pop-up-p');
    const popUp = pElement.closest('[role="dialog"]');
    if (popUp) {
        popUp.style.height = '';
        popUp.style.width = '';
        <http://popUp.style.top|popUp.style.top> = '50%';
        popUp.style.left = '50%';
        popUp.style.transform = 'translate(-50%, -50%)'
    }
</script>
`;

dialog.create({
    buttons: ...,
    title: ...,
    message: message
});
🫡 1