Friday, February 22, 2019

PHP Toolkit 2012.2 > getSelectValue Sample Code

This provides a sample code to make a getSelectValue request using PHPToolkit 2012.2.  The article requires a basic understanding of PHP and Web Services to get this working.

The following example attempts to get all available shipping method of a Sales Order:

     <?php

     require_once './PHPToolkit/NetSuiteService.php';

     set_time_limit(0);

     $service = new NetSuiteService($pref);
     $service->setPreferences(false, false, false, true);

     $fieldDescription = new GetSelectValueFieldDescription();
     $fieldDescription->recordType = RecordType::salesOrder;
     $fieldDescription->field = "shipmethod";

     $request = new getSelectValueRequest();
     $request->fieldDescription = $fieldDescription;
     $request->pageIndex = 0;

     $getResponse = $service->getSelectValue($request);

     var_dump($getResponse);

No comments:

Post a Comment