Does anyone have any idea about how to identify ma...
# suitescript
l
Does anyone have any idea about how to identify matrix item option from a matrix item? Let’s say I have 5 matrix item field, but on Item A, I’ve only use 2 matrix item field, on Item B I’ve use 3 matrix item. Is any possible to do that?
b
get all the fields and look for the ones prefixed with matrixoption
l
@battk prefixed means field internal id? or something else
b
use Record.getFields() to get an array of string internal ids
filter to the ones beginning with matrixoption
l
Got it, so here is my final steps 1. Record.getFields() list all item fields 2. filter our all field with prefix
matrixoption
3. get internalId by remove
matrixoption
4. use Record.getFieldValue(), if is not empty meaning this field is using as matrix option