Hi guys, sorry to bug you but I am literally just ...
# suitecommerce
b
Hi guys, sorry to bug you but I am literally just starting learning NetSuite and I am following a tutorial to create my first extension. We are using SCA 2019.1. I was wondering if you had issues with the path when using: this.urlRoot = function () { return Utils.getAbsoluteUrl( getExtensionAssetsPath( "Modules/ExtensionTestB/SuiteScript/ExtensionTestB.ExtensionTestB.ServiceController.js" ), false ) } I am getting the error: Impossible to parse backend error. Any help would be really appreciated!
s
Which tutorial are you following? I don't think we've written a tutorial for 2019.1.
b
Hi @Steve Goldberg I am following this one: https://developers.suitecommerce.com/develop-your-first-extension.html but we are in 2019.1 so there are some differences in the paths for services for example and also in 2019.1 we're using service controllers.
b
In 19.1 my frontend models look more like this:
Copy code
return Backbone.Model.extend({
      urlRoot: Utils.getAbsoluteUrl('extensions/Test/Test_Extension/1.0.0/services/TestExtension.Service.ss')
    });
With a servicecontroller.js file that has
Copy code
return ServiceController.extend({

      name: 'TestExtension.ServiceController',

      // The values in this object are the validation needed for the current service.
      options: {
        common: {
          requireLoggedInPPS: true
        }
      },

      get: function () {
        var id = this.request.getParameter('id');
        return TestModel.get(id);
      }
and an autogenerated
<http://TestExtension.Service.ss|TestExtension.Service.ss>
located in the extension
assets/services
folder
which would look something like :
Copy code
function service(request, response) {
  'use strict';

  try {
    require('TestExtension.ServiceController').handle(request, response);
  } catch (ex) {
    console.log('TestExtension.ServiceController ', ex);
    var controller = require('ServiceController');
    controller.response = response;
    controller.request = request;
    controller.sendError(ex);
  }
}
b
Ahh, thank you!! This is being super helpful. Question, how is that file autogenerated? Do i need to run a specific command?
s
You're using a tutorial that is not suitable to your version of SCA, so that's probably why you're experiencing problems
b
Yes that is the issue. I really appreciate your help!
🙂
b
I’m not 100% sure but I think if you have the SuiteScript files included in the manifest when you gulp:extension deploy it will create the service.ss files
b
@Steve Goldberg Which tutorial would you recommend for 2019.1 and for a newbie? 😅
s
There's not a good fit for that version. This tutorial covers core code customisations that is probably OK for 2019.1: https://developers.suitecommerce.com/kilimanjaro-aconcagua-20182-developing-your-first-suitecommerce-advanced-customization.html
🙏 1
This example customisation was written for 2019.1: https://developers.suitecommerce.com/add-a-button-to-download-order-history-as-a-csv-file.html. It may teach you what you need to know.
🤩 1
b
Thank you, Steve!