Set the opening window in center

const handleButtonClick = () => {

           try {

               let currentRec = currentRecord.get();

               let recId = currentRec.id;

               let indexUrl = currentRec.getValue({ fieldId: “custpage_redirect_url” });

               let redirectUrl = `${indexUrl}&invId=${recId}`;

               let width = 1300;

               let height = 700;

               let left = (screen.width – width) / 2;

               let top = (screen.height – height) / 2;

               window.open(redirectUrl, ‘_blank’, `location=yes,height=${height},width=${width},scrollbars=yes,status=yes,left=${left},top=${top}`);

           } catch (err) {

               console.error(“error@handleButtonClick”, err);

           }

       }

Leave a comment

Your email address will not be published. Required fields are marked *