How can you call a suitelet from a user event with...
# suitescript
s
How can you call a suitelet from a user event without making it? I keep getting a 500 error
Copy code
var suitletURL = url.resolveScript({
    scriptId: 'customscript_osm_sl_sn_trans_order',
    deploymentId: 'customdeploy_osm_sl_sn_trans_order',
    returnExternalUrl: true
});
var response = <http://https.post|https.post>({
    url: suitletURL,
    body: JSON.stringify({recordType: newRec.type, id: afterRec.id}),
    headers:headerObj
});
b
Any reason you dont use the code from the suitelet inside the user event
s
@battk whatcya mean?
b
Take whatever code in the suitelet and run it in the user event instead
Preferably in a custom module
s
ah! I have to save it in a suitelet so that the other user event scripts can be triggered
b
Same thing, take whatever code is in the other user event and run it in the user event
s
can't. It's from a non accessible script
b
use https.requestRestlet with a restlet instead