oh, I'm using SS1.0, I guess I should start using ...
# suitescript
s
oh, I'm using SS1.0, I guess I should start using SS2.0, create a form in the Suitelet and then attach my client script to that form to run on initialization, correct?
v
just FYI - SS1.0 equivalent for this would be form.setScript(clientScriptId)
s
Thanks @Vaid, new question now: how do I pass my variable from the client script to the Suitelet?
v
What are you trying to do ?
if you have to receive the value in your suitelet after submitting your form, set the value in a form field using nlapiSetFieldValue, if you want to reload the form -- you can set the variable as an http param to your suitelet url and then use window.location = Suiteleturl + param or window.open methods to reload the form(here you can use request.getAllParameters() or request.getParameter({name: paramname}) to get your variable value
s
Hey @Vaid, I'm trying to use a client script to capture a whole bunch of HTML data from budget records then dump it to be displayed in a Suitelet. Having trouble creating a InlineHTML form field where I can have the client script put the html data..
r
instead of passing the variable, create a hidden field with the suitelet and put the value in that field. Then your client script can get the value using nlapiGetFieldValue(<fieldid>)
v
@SuiteBender: Hi, If you want to keep using existing way simply add the inlinehtml or Richtext field to the suitelet form in your suitelet code(this is kind of server side) -- See form.addField(name, type, label, sourceOrRadio, tab) --(Check nlobjForm and nlobjField in Help documentation.) Then do as @rustyshackles said, update that field from your client script code. Btw, can't you capture the data from budget records in your suitelet code itself ? Collect the data in suitelet code & set the html field default value to your html( converted to html string)
@rustyshackles: Gerrom , Is that you. So nice to see you here... remember me? ( Pat's friend )