RE: Calling SS2.0 modules from SS1.0 and passing context object

Not sure if this is possible….I have an overly complex set of Custom Form Scripts written in 1.0 that I don’t have time to replicate in 2.0 right now.  I’d like to be able to call some code that resides in a SS2.0 module.  I can call functions in the module while in SS1.0 by using require(['/SuiteScripts/2.0/module/my_module'], function(my_module) {my_module.myfunction();}); and it’s reaching the function ok.

The problem is, this function expects to be called from a SS2.0 PageInit, and be passed the context object that’s available in SS2.0 Custom Form (Client) Scripts.

Is there a way to access or create this context object inside my SS1.0 script?  More simply, is there a way to gain access to the context object somehow OTHER than when it’s passed in by default to PageInit() and other functions in a SS2.0 Custom Form (Client) Script?

jen Beginner Asked on May 13, 2020 in SuiteScript.
Add Comment
2 Answers

It doesn’t look possible. Which part of the context object would you be using, the currentRecord? In SS1.0,  you can also get the record, using nlapiGetRecord(). However, if you built your context object with it, it doesn’t seem like it would support the SS2.0 APIs, as it is an nlobjRecord type, not an N/currentRecord.CurrentRecord.

Rookie Answered on May 13, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.