anyone know what's the green banner object is call...
# suitescript
l
anyone know what's the green banner object is called? how to send message for it to display in suitelet? 🙏🏻🙏🏻
l
Thank you @Marvin for the pointer. chatgpt tells me to use both server side and client side script to work. is it true?
j
You can make those messages show via UserEvent scripts too, onPageLoad using context.form.addPageInitMessage
m
The
N/ui/message
module is only available in clients scripts. So when using a Suitelet you need to load the client script that would include it. Client script would be if displaying the message is dynamic by changes on the user side. How to add in a suitelet -> https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4625432742.html#Assistant.clientScriptModulePath
If you want the message to display on load by values that are already set. In a suitelet you don't need a UE. You just need the module
N/ui/serverWidget
-> https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1530198114.html#bridgehead_1531327506
l
thanks. I tried Form.addPageInitMessage in suitelet. throwing error. I'll try to troubleshoot.
m
You created the form using
N/ui/serverWidget
?
Like this.
Copy code
let form = serverWidget.createForm({
                title: 'Simple Form'
            });
l
yes correct serverWidget.createForm()
ReferenceError: "message" is not defined.
m
Search for where you are using
message.
l
m
Yeah. You will have to get the enum value instead of using the enum.
replace emun
message.Type.INFORMATION
with string
"INFORMATION"
l
ReferenceError: "INFORMATION" is not defined I'm sure I'll figure out. thanks Marvin
m
make sure it's a string value.
l
put information in quotes?
☝️ 1
nope🤣
m
What is the error?
l
message not defined. i think it's complaining on the second message parameter
m
Oh you need to delete the line that starts with
var messageObj
1
🙌 1
Can you copy your script section in full into a code block and I will return you the correct code.
l
👍 2