SuiteScript root that is
# suitescript
k
SuiteScript root that is
b
put in the full path to react.js in your define statement
otherwise use a require Configuration
k
Ah ok I tried using the relative path and copied it to the same directory as my react app and sure enough the IDE doesn't see it as a valid NetSuite module
ugh, what a headache. I just wanted to make this interface more useful than the standard suitelet list
b
react is for browser side usage, so at the very least you need to put your define's there
you would not actually put it in the suitelet script
k
yeah it's being called from my client script at the moment
the suitelet just defines which client script it's using
b
more normal is writing everything in react and using the html it generated as the output of your suitelet
k
Yeah that's how I've got it
Suitelet contains a div which gets replaced by the react content
Suitelet has a regular client script that calls the react app
Is that not what you mean?
b
as in you do nothing or close to nothing using serverWidget
k
Right, the suitelet just displays the container div for all the stuff that goes on in react
b
as in use ServerResponse.write to write the entire html page
or minimal serverwidget, which involves using an inline html field whose default value is your entire html page
k
Oooh that does sound better
then just use vanilla react instead of NetSuite's modules from the client script?
b
honestly it depends what you want
if you want everything react, then the two options I gave are ideal
if you want partly react, partly serverWidget, then the inline html field is an option
the other option is client script, which sounds like what you are attempting
I can tell you that all 3 can work
k
We are nearing the end of implementation and there's functionality in their legacy system that they need duplicated in NetSuite. Namely they need a search dialog of bills and their payments to send to the bank in XML format. The problem is the native suitelet list functionality is very limited. The AP team needs to be able to filter by vendor and date, then select the bills they want included and click a button to generate the XML file.
I can't get the native suitelet functionality to be that interactive
Which reminded me that I'd done similar in react before
I just don't remember how I set it up from scratch. 😣
I guess what I'm looking for is any generic suitelet with a react client script that I can use as a basis to add the rest of the functionality.
I'd be happy if I could get a hello world to display at this point
b
what does the client script look like
k
At the moment it just calls the react script no more no less, then logs "hello world"
it dies before it gets to the hello world. I'm just commenting things out one line at a time until it runs now
I got the react script to log the hello world!
😄
Now to add in components as needed
I guess I just talked a lot in here for nothing
thank you for helping though. 🙂
It at least gave me a better idea of where to look
e
The native Netsuite suitelet can do what you need. You will need 2 buttons one of which is the standard submit which will trigger a POST to filter a sublist of records populated by a saved search using 3 fields, one for your vendor list and 2 for your date range. And then you will need a checkbox field for each record row on the filtered sublist. Your custom client-side button will then trigger the rest of your process after collecting the internal id of each record selected via the checkbox.
k
I'd still like to use react/redux if possible because I'd like to add more functionality in the future that it would go well with. The hard part is just getting it playing nice with NetSuite.
I've got it working with react now but it still doesn't see the functions within redux
Maybe it's my transpiler
I've resolved all issues. All I had to do is use the HITC tools and it worked flawlessly first try.