Script to set a button and navigate to suitelet using a custom Inline HTML Field

Script to set a button and navigate to a suite let using a custom Inline HTML Field

function createBatchButton(recId)

{

let suiteletUrl = _url.resolveScript({

            scriptId: ‘customscript_jj_sl_batch_steri_76’,

            deploymentId: ‘customdeploy_jj_sl_batch_steri_76’

          });

          suiteletUrl += ‘&custpage_id=’ + recId;

          suiteletUrl += ‘&custpage_type=customrecord_vr_job’;

 let buttonValue = `<html>

          <br/>

          <input

            type=”button”

            value=”Create Batch”

            id=”jj_upload_button”

            onclick=”window.open(‘${suiteletUrl}‘, ‘_blank’, ‘width=800,height=800,toolbars=no,menubar=no,location=no,resizable=yes,scrollbars=yes’);”

            style=”

              background-color: #607799;

              border: none;

              color: white;

              padding: 5px 11px;

              text-align: center;

              text-decoration: none;

              display: inline-block;

              font-size: 14px;

              cursor: pointer;”

            onmouseover=”this.style.backgroundColor=’#405c73?;”

            onmouseout=”this.style.backgroundColor=’#607799?;”

          />

          <br/>

        </html>

      `;

          newRec.setValue({ fieldId: ‘custrecord_jj_createbatch’ , value: buttonValue});

}

Leave a comment

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