Hey guys, I'm trying to create an extension for a ...
# suitecommerce
h
Hey guys, I'm trying to create an extension for a demo and I'm getting the following error on my console as well as my extension not showing up in the Extension Manager, not sure if both are separate problems of if they are related. My ServiceController get function is just
return JSON.strigify({ name : 'Hello World' });
Error:
Impossible to parse backend error - Request {"url":"....
m
The return does an implicit json stringify operation so just return the object. Regarding the extension not showing up, it happens when the target versions defined in manifest.json are not compatible. They should have a >= prepended before it.
p
strigify
No idea what a strig is :)
h
Copy code
define("BHS.ThirdPartyShipping.ThirdPartyShipping.ServiceController", ["ServiceController", "BHS.ThirdPartyShipping.ThirdPartyShipping.Model"], function(
  ServiceController,
  ThirdPartyShipping
) {
  "use strict";

  return ServiceController.extend({
    name: "BHS.ThirdPartyShipping.ThirdPartyShipping.ServiceController",

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

    get: function get() {
      return { name : 'Hello World' }; //ThirdPartyShipping.get());
      
    },

    post: function post() {
      // not implemented
    },

    put: function put() {
      // not implemented
    },

    delete: function() {
      // not implemented
    }
  });
});
Hmmm I've changed it to not have the JSON.stringify and also tested by fixing the typo but still same console error
message has been deleted
m
Have you deployed the service? And are you using jQuery.get or client-side model.fetch?
h
I have deployed it but not activated it. I'm still testing locally. I'm using .fetch in my View file
Copy code
var collection = new ThirdPartyShippingModel();			collection.fetch().done(function (data) {
				console.log(data);
			});
m
The back-end service only works once deployed and activated. Please activate and try again.
h
So it looks like my Extension tools are version 20.1.0 but the installed SCA bundle is 2019.2.1. I set the manifest.json of my extension to have the target versions be
>=19.2.0
I ran
gulp extension:update-manifest
and
gulp extension:deploy
but I still don't see it in my Extension Manager
m
There is a custom record for deployed SC Ext. You need to change the target version json string to have >= if not already. After the changes you should be able to see your extension for activation.
h
Do you know where to find this record? I'm looking at Record Types in NetSuite but can't see this
I think I found it
Yep found it. I changed the version and now it shows in the Extension Manager. I'll activate it and see if I still get that console error
m
Great! It will work.
h
You are correct it works! Thank you so much!
m
Don't forget to deploy + activate each time you make a change in the back-end service. Use this command to deploy the SuiteScript part only
gulp extension:deploy --source ssp-libraries