Script 101 question : this is my first time deploy...
# suitescript
s
Script 101 question : this is my first time deploying client side script. do I need to fill in this boxes?
s
whatever is called at that particular moment, it's like how suitescript2.x works in the return block at the bottom
w
It looks you are making a Suitescript v1 client script. yes. Put the names of your event functions.
s
Copy code
function helloWorld(){
  console.log('sup');
}
suppose I have this, and I want it called at pageInit, i'd fill helloWorld on the pageInit part
s
oh ok so i want to make Entity (line) mandatory
function clientValidateLine(type){
I found this script in SuiteAnswer, i want to see if it works or not, before going to partner
is that it? or do i need to fill in any other fields? on script setup
s
i'd test it out but the way i see this as it is without the script context
you'd put that at validate line and do a unit test
mandatory has two forms, you either check the field everytime, or you hard code is as mandatory when the form loads I assume you're doing the mandatory as in checking the field, so those cases validate line will do
caviat is sublists, so I would imagine you're doing check the field every time based on that too (although this has been changing with NetSuite upgrades, so I'm not certain that caused design choices)
s
Yeah I am trying to make Name field mandatory on the Journal Entry because we are getting lot of entries in -No Vendor- No Customer accounts
s
it depends if you need to get information from those records using script, and I dont have a good way of doing that either without either doing a search or loading it it depends on if you want to make the name field mandatory for specific accounts or all of them, this design philosophy will change the way you tackle this problem
s
for all accounts, I want it on the entry or before record load
s
in all accounts case, you'd probably want it before submit and block the creation
s
but doesn't the name field needs a star? its not coming up
s
i think the norm for practice for the name field is only AR/AP for "lines" of journals, especially intercom cases
the name field is difficult to require a star because to my understanding ns doesnt do dynamic field mandatory, meaning the whole column is mandatory or the whole column is not mandatory
s
hmm so even if it doesn't show the star it might have worked, let me do one test, i was waiting for the star before doing tests
no that didn't work, it let me go to next line without the name
s
no i mean it as in you need to put the function on validateLine, and block it with validateLine instead of mandatory on the form which will load the sublist with the star
in this case of validateLine then you wont have a star on the field, but you can trigger a prompt with say alert() to alert to the user it wasn't mandatory
its been a while but the client script returns means things, so if you return false in the function it'll block
usually
s
Yeah I do have alert in the script alert('Please enter a value for Name field)
This is the script i got
s
this looks alright
deploy this on validate line on the script record for 1.0 scripts and it should be ok
s
i think that is what I did
s
this needs to be clientValidateLine
unless you embeded what you showed me in ValidateLine
so two things do you call
Copy code
clientValidateLine anywhere in ValidateLine
and what are you calling for ValidateLine when you normally call it
s
message has been deleted
awesome!!!! thanks
1
i change to client validate line, i think that was the issue
s
yea, 1.0 is old and strange haha
good luck!
s
it doesn't have the star though but it's good a thing, it doesn't lose data when you get the error
change in plan : he does want the only mandatory for A/P and A/R Account