RE: Getting 500 error code while using https.get API in Suitelet Script

I want to call user event script from suitelet. I am using https.get API. But Getting error code 500. Below is my code:

*@NApiVersion 2.x
*@NScriptType UserEventScript
define ( [‘N/record’,’N/search’,’N/ui/dialog’,’N/https’,’N/url’,’N/currentRecord’,’N/http’,’N/format’] ,
function(record,search,dialog, https,url, currentRecord,http,format) {

function afterSubmit(context) {

if(context.type == ‘create’ || context.type == ‘edit’){
var rec=context.newRecord;
//Load Work order
var work_Order_obj = record.load({
type: record.Type.WORK_ORDER,
id: recId,
isDynamic: true

//Get Document Number
var docNumber = work_Order_obj.getValue({
fieldId: ‘tranid’

var suiteLetURL = url.resolveScript({
deploymentId: ‘customdeploy_suitelet_work_order_issue’,
scriptId: ‘customscript_suitelet_work_order_issue’,
returnExternalUrl: true,
params: {‘internalId’: recId, ‘documentNumber’:docNumber}
log.debug(‘suiteLetURL’, suiteLetURL);

var request = https.get({
url: suiteLetURL



return {
// beforeLoad: myBeforeLoad,
//beforeSubmit: beforeSubmit,
afterSubmit: afterSubmit

Maira S Beginner Asked on February 15, 2023 in SuiteScript.
Add Comment
7 Answers

Is the Suitelet set to “Available without Login”?

Intermediate Answered on February 15, 2023.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.