Netsuite | GetSelectValue PHP webservice code sample

The GetSelectValue operation is used to return the entire list of values or just a subset of values. This example will guide developer how to perform a GetSelectValue operation thru web service using PHPToolkit.

This article requires existing knowledge of Web Services and PHP. The example will get the values on the salesrep field of the opportunity record.

require_once 'PHPtoolkit.php';
require_once 'login_info.php';
global $myNSclient;

$gsvFld = new nsComplexObject('GetSelectValueFieldDescription');
$gsvFld->setFields(array('recordType'=>'opportunity', 'field'=>'salesrep')); 

//assign the result to extract the result
$getSelectValueResponse = $myNSclient->getSelectValue($gsvFld);

print_r($getSelectValueResponse);

The above code would generate the following SOAP:

Request:


    
        
            .........
**********
            ...........
            
        
    
    
        
            
                opportunity
                salesrep
            
            1
        
    

Response:


    

WEBSERVICES_TSTDRV570143_0103201112862020801890529_3e580a76a
        
    
    
        


5
1


EMPL10 Annie Annie
                    

EMPL6 Employee Sample 4
                    

EMPL8 Rose Rose
                    

EMPL9 Joy Joy
                    

EMPL93 Sales Rep Elle
                    
                
            
        
    

No related posts.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>