so is there a way to set a line field as mandatory...
# suitescript
t
so is there a way to set a line field as mandatory via client script in SS 1.0 or SS 2.0
b
affects the entire column, not just a single row
t
right but it won't work unless there is a line already committed
Or did they fix that?
Yeah you can't grab the column unless a line exists and no line exists initially
Or wait you get column from somewhere else
b
if you dont want to resort to dom manipulations, you can also use nlapiSetLineItemMandatory in ss1
not much better since its undocumented
expect to use nlapiRefreshLineItems afterwards
t
yeah nlapiSetLineItemMandatory is inconsistent for me
I think your suggestion works. Whats weird is that you can get either the field or the column with getSublistField or getColumn which are two different functions for two different objects with the same 'isMandatory' attribute
b
probably not actually the isMandatory attribute
all the ss2 stuff is about generating proxies to the original javascript functions on the page
in this case I believe the chain ends in the setRequired function
t
So using field vs column and setting "isMandatory" has the same effect. The only thing is that column works in all contexts while field require a line to be present already before you can use its function because its line specific
I didn't know about the column deal at all so thanks for showing me that. I've always used the field method which doesn't work as well
218 Views