It seems that `nlapiSetFieldValue()` works on inli...
# suitescript
j
It seems that
nlapiSetFieldValue()
works on inlineHTML fields, but not
context.currentRecord.setValue()
. Can someone confirm I’m not just doing something dumb?
n
I have experienced the same behavior.
j
Thanks @NickSuite
r
was having the same issue, give your html element some id and use document.getElementById(':); and then use innerText.
n
@raghav you can use SS 1.0 as a workaround.
r
Script was written in SS2.0. Rather then changing the wholescript to SS1.0 as a workaround. The solution is to use document.getElementById and set the innertext of that html element which is working in 2.0
n
You don't need to change the whole script.
You can write SS 1.0 code in SS 2.0 client script.
r
Oh yeah, we could create one more client script in 1.0 just to trigger that particular field change event. Didn't felt it was optimal though. Setting innertext of HTML just worked better.
n
You are not getting the point. It's alright.
r
I did. I could create a client script in 1.0 to trigger the field change event for the logic I needed to implement. But unnecessary setting multiple client script when the task could be done with a different approach in existing 2.0 client script will still be better right ? Will not create the code complex for the future developer who will be reading it.
n
Like I said, you didn't get what I was saying.
r
Oh, i just read it again. My bad.
Can you please explain how can we use SS 1.0 code in a SS2.0 script? Bit curious about it. Are there some annotations I have to add?
n
Just simply write the 1.0 code.
r
Hmm will check once and get back to you. I remember I used to get error whenever I used 1.0 APIs in 2.0 script. Will check once just to be sure.
n
It works only with client script.
j
you can literally just put nlapi fns in your SS2 script.
(client)
anyhow, I’m just making the default value of my inlineHTML
<div id="whatever"></div>
and then doing
jQuery('#whatever').html('the new content');
instead. Works ok and I’ve used this method before.