Michael McNamara
08/15/2023, 10:46 PMAnthony OConnor
08/15/2023, 10:55 PMcontext.request.method
The piece you have already should all be wrapped in a GET
conditional
if (context.request.method === 'GET') {
***paste evernthing from your link***
}
Then you need a section to handle the incoming form data when they click submit, clicking "submit" is a POST
rather than a GET
if (context.request.method === 'POST') { *add your new coder here* }
Probably easier to look at this one to get the idea
https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/article_159022995775.html#Write-and-Send-EmailMichael McNamara
08/15/2023, 10:57 PMAnthony OConnor
08/15/2023, 10:57 PMMichael McNamara
08/15/2023, 10:57 PMAnthony OConnor
08/15/2023, 11:07 PMfunction onRequest(context){
if (context.request.method === 'GET') {
onGet(context);
}
if (context.request.method === 'POST'){
onPost(context);
}
}
function onGet(context){
//do the GET things
}
function onPost(context){
//do the POST things
}
return{onRequest};
Michael McNamara
08/15/2023, 11:12 PM