al3xicon: Instead of using nlapiLookupField, I used this function:
'''function get_ent_record_type(id) {
return search.create({
type: search.Type.ENTITY,
filters: ['internalid', search.Operator.ANYOF, id]
})
.run()
.getRange({
start: 0,
end: 1
})[0]
.recordType
}'''
where id is the entity record internal id. You could adjust it for transaction.