I made a field mandatory via client script, the re...
# suitescript
r
I made a field mandatory via client script, the red asterisk appears on the page, but it can be saved without populating.
n
If that doesn't work maybe shift your logic to save and pop an alert / message.
m
I've found that the
isMandatory
property doesn't actually add the validation that you'd expect it to, it just adds the asterisk - it's pretty weird, but using it in conjunction with custom validation in
saveRecord
generally works fine.
👍 1
r
saveRecord
works. Thanks
Ya, I don't think I agree with your assessment @MTNathan. It does produce alerts for all the native fields. It seems to be just for a custom List / Record field that this issue arises.
m
Oh interesting, I thought that maybe it was just inconsistent but I've stopped relying on it at all since I hadn't noticed a pattern. Good to know that it may be able to work on its own for native fields though.
r
No, I'm wrong. The native fields are mandatory according to field level validation, not client scripting.
whoopsie whoopsie
m
Ah yeah, that makes sense. For what it's worth, the documentation for
N/currentRecord
doesn't list
isMandatory
as read only, so this seems like a defect to me (at least incorrect documentation). But good luck getting NS support to agree with that assessment...