how can i get the netsutie navbar on a suitelet
# suitescript
s
how can i get the netsutie navbar on a suitelet
j
It’s there by default if you use
context.response.writePage(form);
s
yes that is fine for the form , once the user click submit is my quesntion
j
…. what are you doing after submit? It POSTs back to the same page, so you can do another context.response.writePage(form);
e
when the submit button is pressed it sends a POST call so you will need to reload the form.
s
the truth I need to rethink this all i need is for a user to be able to fire off this script which makes an external API call
rethinking this ... im trying to create a portlet that on submit will fire off a client script to make external API call
Copy code
/**
 * @NApiVersion 2.1
 * @NScriptType Portlet
 * @NScriptPortletType form
 */
define(["N/https", "N/ui/serverWidget"], function (https, serverWidget) {
  function ngForm(params) {
    log.debug({ title: "new data ", details: params });
    var portlet = params.portlet;
    portlet.title = "Extrenal Api Click to sync Amazon Fba Shipments";
    portlet.clientScriptModulePath = "./railApi.js";
    var submitButton = portlet.addButton({
      id: "custpage_submit_button",
      label: "Submit",
      functionName: "fire_api",
    });
    var newfld = portlet.addField({
      id: "cbox_ng",
      type: "checkbox",
      label: "Please confirm",
    });
    newfld.updateLayoutType({
      layoutType: "normal",
    });
    newfld.updateBreakType({
      breakType: "startcol",
    });

    // portlet.addSubmitButton({ label: "Submit" });
  }
  return {
    render: ngForm,
  };
});
"name":"MODULE_DOES_NOT_EXIST","message":"Module does not exist: /SuiteScripts/railApi.js","stack":["Error\n at Object.ngForm (/SuiteScripts/railsPortlet.js:11:5)
r
Is the module in your pwd?