Skip to content
Advertisement

How do I get the sales order items by the sales rep in netsuite api with PHP?

Here is the situation, I’m trying to get the sales data based on the sales rep id.

Here is what I have tried (of course failed)

     $request->baseRef = new RecordRef();
     $request->baseRef->internalId = 730;
     $request->baseRef->type = 'salesRep';
     $getResponse = $service->get($request);

What will be the best way to the sale information based on the salesRep id?

Thank you, Kevin Davis

Advertisement

Answer

Found a solution….

The problem was that I have to do a multi-select field. So instead of doing what I did that is above, here is my solution:

    $type = new SearchEnumMultiSelectField();
    $type->operator = 'anyOf';
    $type->searchValue = array('_salesOrder');
    $search->type = $type;

    $salesRepRef = new RecordRef();
    $salesRepRef->internalId = 730

    $params = new SearchMultiSelectField();
    $params->operator = 'anyOf';
    $params->searchValue = array($salesRepRef);
    $search->salesRep = $params;

That returned the information that I needed.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement