Buscar..


Introducción

Éstas son algunas de las cosas más difíciles (y de las que menos se habla) que se pueden hacer con la búsqueda avanzada de la API de PHP (donde se especifican los campos).

Estoy en el proceso de migrar a rest_suite github library que usa RESTLET, y sortear el límite de concurrencia de usuarios de la API de PHP de 1.

Pero antes de borrar mi antiguo código, lo estoy publicando aquí. Las especificaciones de ejemplo para estos campos se pueden encontrar aquí: http://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2016_1/schema/search/transactionsearchrow.html?mode=package

Uso de customField y customFieldList

$service = new NetSuiteService();
$search = new TransactionSearchAdvanced();
$internalId = '123';//transaction internalId

$search->criteria->basic->internalIdNumber->searchValue = $internalId;
$search->criteria->basic->internalIdNumber->operator = "equalTo";

$field = new SearchColumnSelectCustomField();
$field->scriptId = 'custbody_os_freight_company';//this is specific to you & found in netsuite
$search->columns->basic->customFieldList->customField[] = $field;

$field = new SearchColumnStringCustomField();
$field->scriptId = 'custbody_os_warehouse_instructions';//this is specific to you & found in netsuite
$search->columns->basic->customFieldList->customField[] = $field;

//and so on, you can keep adding to the customField array the custom fields you want

$request = new SearchRequest();

$request->searchRecord = $search;

$searchResponse = $service->search($request);

customSearchJoin Usage

$service = new NetSuiteService();
$search = new TransactionSearchAdvanced();
$internalId = '123';//transaction internalId

$search->criteria->basic->internalIdNumber->searchValue = $internalId;
$search->criteria->basic->internalIdNumber->operator = "equalTo";

$CustomSearchRowBasic = new CustomSearchRowBasic();
$CustomSearchRowBasic->customizationRef->scriptId = 'custbody_os_entered_by';//this is specific to you & found in netsuite
$CustomSearchRowBasic->searchRowBasic = new EmployeeSearchRowBasic();
$CustomSearchRowBasic->searchRowBasic->entityId = new SearchColumnStringField();

$search->columns->customSearchJoin[] = $CustomSearchRowBasic;
//and so on, you can keep adding to the customSearchJoin array the custom fields you want         

$request = new SearchRequest();

$request->searchRecord = $search;

$searchResponse = $service->search($request);


Modified text is an extract of the original Stack Overflow Documentation
Licenciado bajo CC BY-SA 3.0
No afiliado a Stack Overflow