Jacob D
10/26/2021, 7:05 PMgetRecordType()
in SS2.0? I’m having a hell of a time working with records that could have multiple types. They’re all items, but some could be assembly items, some could be inventory, some could be kits, etc. Is there a way to determine a record’s type if you don’t already know it?eblackey
10/26/2021, 7:07 PMJacob D
10/26/2021, 7:42 PMscottvonduhn
10/26/2021, 7:43 PMJacob D
10/26/2021, 7:47 PMscottvonduhn
10/26/2021, 7:49 PMdbarnett
10/26/2021, 7:51 PMsearch.lookupFields({ id : XXXXX, type : search.Type.ITEM, columns : 'recordtype' })
which will give you the true 'recordtype' value if you then need to use it elsewhere to load the record by Type etc.Jacob D
10/26/2021, 7:55 PMfunction getAssociatedItem(assID) {
try {
var associatedItem = nRecord.load({
type: nRecord.Type.INVENTORY_ITEM,
id: assID,
isDynamic: true
});
return associatedItem;
}
try {
var associatedItem = nRecord.load({
type: nRecord.Type.ASSEMBLY_ITEM,
id: assID,
isDynamic: true
});
return associatedItem;
}
try {
var associatedItem = nRecord.load({
type: nRecord.Type.KIT_ITEM,
id: assID,
isDynamic: true
});
return associatedItem;
}
}
scottvonduhn
10/26/2021, 8:01 PMscottvonduhn
10/26/2021, 8:02 PMJacob D
10/26/2021, 8:03 PMJacob D
10/26/2021, 8:06 PMscottvonduhn
10/26/2021, 8:07 PMcreece
10/26/2021, 8:21 PMJacob D
10/26/2021, 9:08 PM