iSuite
02/10/2021, 4:14 PMSteve Goldberg
02/10/2021, 4:36 PMSteve Goldberg
02/10/2021, 4:36 PMget() work, without passing in the name property name?iSuite
02/10/2021, 4:38 PMSteve Goldberg
02/10/2021, 4:51 PMSteve Goldberg
02/10/2021, 4:51 PMiSuite
02/10/2021, 5:10 PMiSuite
02/10/2021, 5:22 PMSteve Goldberg
02/10/2021, 5:23 PMiSuite
02/10/2021, 5:33 PM// Model.js
// -----------------------
// @module Case
define("Urb.UrbanSurfacesMods.BackendTesting.Model", ["SCModel", "Utils"], function(
SCModelModule,
Utils
) {
"use strict";
// @class Case.Fields.Model @extends Backbone.Model
var SCModel = SCModelModule.SCModel;
function BackEndTestingModel () {
SCModel.call(this);
this.urlRoot = function() {
return Utils.getAbsoluteUrl(
getExtensionAssetsPath(
"Modules/BackendTesting/SuiteScript2/Urb.BackendTesting.Service.ss"
), true
)
}
}
BackEndTestingModel.prototype = Object.create(SCModel.prototype);
BackEndTestingModel.prototype.constructor = BackEndTestingModel;
return BackEndTestingModel
});Steve Goldberg
02/10/2021, 5:40 PMiSuite
02/10/2021, 5:46 PMiSuite
02/10/2021, 5:46 PMdefine(
'Urb.MyAccountMods.MyAccountsModsModule'
, [
'Urb.UrbanSurfacesMods.BackendTesting.Model'
]
, function (
BackEndTestingModel
) {
return {
mountToApp: function mountToApp(container) {
var layout = container.getComponent('Layout')
, userProfile = container.getComponent('UserProfile');
//Set pay invoices button link
if (layout && userProfile) {
layout.on('afterShowContent', function() {
var backEndModel = new BackEndTestingModel();
backEndModel.fetch();
console.dir(backEndModel);
var backEndMessage = backEndModel.get("coolMessage");
console.log(backEndMessage);
console.log('Passed it');
var userProfileData = userProfile.getUserProfile().then(function(profile) {
console.dir(profile);
var customerRecordInternalId = profile.internalid;
`var payStatementsLink = `https://checkout.paystand.com/v4/?publishableKey=yz312co01spfqbx7uwwo1rvj&viewCheckout=portal-medium&module=ns_openInvoices&extCustomerId=${customerRecordInternalId}&externalCss=https:%2F%2Fwww.paystand.com%2Fhubfs%2Fcustom_css%2FUrbanSurfaces%2FUrbanSurfaces.css&logoUrl=https:%2F%2Fwww.paystand.com%2Fhubfs%2Fcustom_css%2FUrbanSurfaces%2Furban_surfaces.png▾
$('#payinvoicesbutton').attr('href',payStatementsLink);
});
});
}
}
}
}
)Steve Goldberg
02/10/2021, 5:50 PMSteve Goldberg
02/10/2021, 5:51 PM.then() to the fetchSteve Goldberg
02/10/2021, 5:52 PMjQuery.when() on itSteve Goldberg
02/10/2021, 5:55 PMiSuite
02/10/2021, 6:04 PMMohammad Sharaf Ali
02/12/2021, 12:38 AMjQuery.Deferred().promise();