I know how to call SS2 stuff from SS1 using someth...
# suitescript
j
I know how to call SS2 stuff from SS1 using something like
require(['/path/to/my_module'], function(my_module) {my_module.myFunction();});
I’m hoping to do this in an old SS1 CustomForm script (used in a Transaction Custom Form) to be able to start moving code from SS1 to SS2 (there is a LOT going on there and doing it all at once is not feasible). If I want to be able to somehow pass through (or reconstruct) the SS2
context
object, is that possible? The functions in my SS2 module are going to expect to be passed a
context
argument.
e
would it be better to start moving complete and isolated pieces of code to another suitescript 2.0 script? Trying to replicate the context argument does not seem the way to go.
j
My Custom Form Scripts call a bunch of code in Library scripts (also in 1.0), some of which are several thousands of lines long with tons of functions
we can’t really easily switch it all over in one fell swoop
well….I say we, but it’s just me which is part of the problem
s
well... if it's clientside, maybe try window.nlapifunctionyouwanttocall? otherwise... embedding to trigger as SS? or maybe even a suitelet? in a 2.0 CS at least from memory
Copy code
window.nlapiSetLineItemValue("item", value, (i+1), fldValue);
will work
j
I’m trying to do the opposite. Call SS2 from SS1. However my SS2 fn expects to be passed
context
as an argument