if i wanna change the text above the field (which ...
# suitescript
e
if i wanna change the text above the field (which was put there in a addfield from a suitelet), which function on the fields do i call (in a client script)?? thanks!
j
Not sure that you can in client without DOM manipulation. What's the use case?
e
message has been deleted
this field was added in by a suitelet, and i wanna change the text above in a CS
d
can you alter the suitelet that adds the field?
Otherwise the only way I can think of is to wrap the suitelet field in a client script field and hide the suitelet field. Which is.... messy
m
You can use the
N/currentRecord
module in a client script and do something like this in
pageInit
Copy code
var rec = currentRecord.get();
        var field = rec.getField({ fieldId: 'custpage_test' });
        field.label = 'New Label';
this 1
e
Copy code
can you alter the suitelet that adds the field?
yes, but i need to go back and forth between options changing the label on the field each time
setLabel should work but says : SSS_NOT_YET_SUPPORTED
m
Just tested this with a suitelet/client script added via
form.clientScriptModulePath
this 1
Here's a simple example. You can see the label change from the client script after the page loads.