Hi <@U8X7E86M6> , did the blog posts that are Deve...
# suitecommerce
k
Hi @Steve Goldberg , did the blog posts that are Developers.SuiteCommerce get moved? Are there new blog posts? The last one on developer website if Feb. 18, 2020. These are incredibly useful.
s
They are still there. I am in the process of trying to get it migrated to a new home but there are delays outside of my control.
k
Fantastic. I am using them now to figure out how to extend a server side model’s method. The help docs on customizing SCA do not include an example of extending a model. On the client side, I’ve been doing this in the mountToApp() method. I haven’t figured out the technique when it’s on the server side.
s
After adding your model as a dependency, you can just attach new methods to it like any other object. (Extending not necessarily required.)
It's surprisingly uncomplicated!
k
Thanks. In my case, I found a defect in the OrderHistory.Detail model’s getFulfillments() method. In an extension, I want to use prototype to replace the method with a fixed version.
I thought I understood how the loading works on the server side, but it’s not working so I am seeing if there is an example somewhere to save me time figuring it out.
Thanks for the help
Thanks for the article. I think I see where I have it wrong on the server side.
s
If you want to completely replace the method, then just doing something like
OrderHistoryDetailModel.getFulfillments = function (a,b,c,etc) {...}
should work.
k
Thanks. I was using “OrderHistoryDetailModel.prototype.getFulfillments = …“, but it was throwing an undefined error. It appears that the methods on the server side models are not defined in the same way as they are on the client side.
It worked. I don’t think javascript on the server side is real javascript as we know it. I tried to display all of the properties of the OrderHistory.Model object using Object.getOwnPropertyNames(OrderHistoryModel), and I received the error message
Copy code
getOwnPropertyNames" is not defined
s
🧐
😅 netsuite
k
Perfect NetSuite icon.