Hi all! How do you set a native sublist column to ...
# suitescript
k
Hi all! How do you set a native sublist column to be mandatory? Or do you need to check for null values in beforeSubmit and throw an error?
l
googled it

https://www.youtube.com/watch?v=tJH04QtQl40

k
Not quite what I was looking for, but thanks!
Currently the customer has a workflow that sets class, department, and location to mandatory at the line level but it only works for the Items sublist. When they go into the workflow action and try to add these fields for the expense and apply sublists, those lists aren't available.
So I'm trying to accomplish the same with a script
r
If you want a scripted solution then you can put a client script with validate line entry point and check if the mandatory columns are filled or empty when the user tries to add a row..
1
k
yeah, I wanted a user event scripted solution so that any other automations/integrations/csv imports could also trigger it, but I can do the same for beforeSubmit really.
The answer is quite simply that it's not possible. https://suiteanswers.custhelp.com/app/answers/detail/a_id/85631/kw/85631
sublist isMandatory is read only
r
Can't this be done via workflow now?
k
It's read only in workflows, too
Best I was able to come up with is validation in beforeSubmit
d
@Kris Wood Follow up question. How do you stop the process from executing in beforeSubmit? Seems to be throwing in error doesn't stop it and return won't do anything either?
k
Throwing an error should stop it. Just make sure you're not in a try/catch or the catch will eat it
d
@Kris Wood Thanks for the heads up on the try/catch. That's why it didn't stop it. Removing the try/catch solved the issue. 😉
👍 1
k
Happy to help!