What is the correct syntax for accessing a Suitlet Parameter as part of the response?

The documentation on N/serverWidget is incorrect or misleading.

My attempt to implement a simple Suitelet with one field.

function onRequest(context){
  if(context.request.method === 'GET') {
    var form = serverWidget.createForm({
      title: "Item Look Up"
    var itemField = form.addField({
      id: 'custpage_itemfield',
      type: serverWidget.FieldType.TEXT,
      label: 'Item'
      label: 'Submit;
  } else {
    var itemParameter = context.request.paramters.itemfield; 
    // Following the NetSuite Documentation
    log.debug("itemParameter", itemParameter);


The Logs show nothing for itemParameter. But if I were to log the full parameters,

log.debug(“context.response.parameters”, JSON.stringify(context.request.parameters));

I clearly see, ‘custpage_itemfield’ with the correct value.
Is the Documentation incorrect? Should I access itemfield using



Beginner Asked on October 9, 2019 in SuiteScript.
Add Comment
1 Answer(s)
Best answer

Bad example. Use context.request.parameters.custpage_itemfield

Advanced Answered on October 9, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor   Become a Sponsor