Compose a mail containing Link to a Purchase Order record using suiteScript.

let poUrl = url.resolveRecord({
    recordType: 'purchaseorder',
    recordId: poId,
    isEditMode: false
});
let companyInfo = config.load({type: config.Type.COMPANY_INFORMATION});
let netSuiteDomain = companyInfo.getValue({fieldId: 'appurl'});
let URLPo = netSuiteDomain + poUrl;
const poLink= `<a href="${URLPo}">Click Here</a>`
let mailContent = `To open the purchase order ${poLink}`
email.send({
    author: authorId,
    recipients: recipientsId,
    subject: "Link to PO",
    body: mailContent,
});

Leave a comment

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