In extensions on SuiteCommerce 2020.1 and later, use SCModel instead of Backbone.Model.

define(

‘MySCModel.Model’,

[

‘SCModel’,

‘Utils’

],

function(SCModelComponent, Utils){

‘use strict’;

var SCModel = SCModelComponent.SCModel;

function MySCModel() {

SCModel.call(this);

// Define properties of the model.

this.urlRoot = function() {

return Utils.getAbsoluteUrl(

getExtensionAssetsPath(“services/MainModule.Service.ss”)

)

}

}

MySCModel.prototype = Object.create(SCModel.prototype);

MySCModel.prototype.constructor = MySCModel;

// Return the AMD constructor.

return MySCModel;

}

);

Leave a comment

Your email address will not be published. Required fields are marked *