cja
cja

Reputation: 10016

How to search for "Lot Numbered Assembly/Bill of Materials" items by external ID using SuiteTalk

WSDL 2014.2. C# in Visual Studio 2013.

I can get "Inventory Item" items using this code:

var recordRefs = new List<RecordRef>();

foreach (string externalId in ExternalIds)
{
    recordRefs.Add(new RecordRef
    {
        externalId = externalId,
        type = RecordType.inventoryItem,
        typeSpecified = true
    });
}

var request = new ItemSearchBasic
{
    externalId = new SearchMultiSelectField
    {
        @operator = SearchMultiSelectFieldOperator.anyOf,
        operatorSpecified = true,
        searchValue = recordRefs.ToArray()
    }
};

SearchResult response = SuiteTalkConnection.Service.search(request);

However, if I change type = RecordType.inventoryItem to type = RecordType.lotNumberedAssemblyItem then I don't get results. I am specifying correct values as external IDs.

I have tried all sorts of variations on the above, including ItemSearch instead of ItemSearchBasic but I never get results.

It doesn't help that I can find zero NetSuite documentation on searching for specific item types.

Upvotes: 1

Views: 718

Answers (1)

Rohit Gupta
Rohit Gupta

Reputation: 593

I think answer to this question would also work in this case. Try using type as "assemblyItem" only and use an additional searchFilter "isLotItem" and set it to true.

Upvotes: 1

Related Questions