am I missing somthing here? column ´item´ in my se...
# suitescript
p
am I missing somthing here? column ´item´ in my search always returns null: ´´´var manufacturingoperationtaskSearchObj = search.create({ type: 'manufacturingoperationtask', filters: [ ['workorder','anyof',currentWorkOrderId] ], columns: [ search.createColumn({name: 'name', label: 'Operation Name'}), search.createColumn({name: 'sequence', label: 'Operation Sequence'}), search.createColumn({name: 'item', join: 'workOrder', label: 'item'}) ] });´´´
n
I think it's your join. It should be workorder
you have a Capital 'O' in there and NS won't recognize it as a valid join field.
p
right thanks. but still returns null 😕
n
p
thats where i got the code from to start with 😛
n
Does the search result in UI have any data in that field?
p
yep
n
Drives me insane. Send a screen-shot of your filters and columns in UI. Wanna try it for myself.
p
yea me 2 xD 1 sec
netsuite 1
Copy code
var manufacturingoperationtaskSearchObj = search.create({
        type: "manufacturingoperationtask",
        filters:
        [
        ],
        columns:
        [
           search.createColumn({
              name: "workorder",
              sort: search.Sort.ASC,
              label: "Work Order"
           }),
           search.createColumn({name: "sequence", label: "Operation Sequence"}),
           search.createColumn({name: "name", label: "Operation Name"}),
           search.createColumn({
              name: "itemid",
              join: "workOrder",
              label: "Item"
           })
        ]
     });
     var searchResultCount = manufacturingoperationtaskSearchObj.runPaged().count;
     log.debug("manufacturingoperationtaskSearchObj result count",searchResultCount);
     manufacturingoperationtaskSearchObj.run().each(function(result){
        // .run().each has a limit of 4,000 results

        var assembly = result.getValue({
            name: 'itemid'
        });

        // here assembly returns null
        return true;
     });
message has been deleted
I found the error, the joined itemid is null, but item exists as a reference number, must have edited the code at some point
because im looking for the shown text, not the reference number