在SugarCRM SOAP API中,如何获取Opportunity status enum的所有可能值?

在SugarCRM SOAP API中,如何获取Opportunity status enum的所有可能值?,sugarcrm,Sugarcrm,是否有一个API调用来获取Opportunity status/stagename enum的所有可能值?下面是通过REST执行此操作的代码,它也应该直接转换为SOAP $parameters = array( 'session' => $sessionId, 'module_name' => 'Opportunities', ); $json = json_encode($parameters); $postArgs = array(

是否有一个API调用来获取Opportunity status/stagename enum的所有可能值?

下面是通过REST执行此操作的代码,它也应该直接转换为SOAP

$parameters = array(
    'session' => $sessionId,
    'module_name' => 'Opportunities',
    );
$json = json_encode($parameters);
$postArgs = array(
                'method' => 'get_module_fields',
                'input_type' => 'JSON',
                'response_type' => 'JSON',
                'rest_data' => $json
                );
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);

// Make the REST call, returning the result
$response = curl_exec($curl);
if (!$response) {
    die("Connection Failure.\n");
}

// Convert the result from JSON format to a PHP array
$result = json_decode($response);
if ( !is_object($result) ) {
    die("Error handling result.\n");
}
if ( !isset($result->module_name) ) {
    die("Error: {$result->name} - {$result->description}\n.");
}

var_dump($result->module_fields->sales_stage->options);
exit;

下面是通过REST实现的代码,REST也应该直接转换为SOAP

$parameters = array(
    'session' => $sessionId,
    'module_name' => 'Opportunities',
    );
$json = json_encode($parameters);
$postArgs = array(
                'method' => 'get_module_fields',
                'input_type' => 'JSON',
                'response_type' => 'JSON',
                'rest_data' => $json
                );
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);

// Make the REST call, returning the result
$response = curl_exec($curl);
if (!$response) {
    die("Connection Failure.\n");
}

// Convert the result from JSON format to a PHP array
$result = json_decode($response);
if ( !is_object($result) ) {
    die("Error handling result.\n");
}
if ( !isset($result->module_name) ) {
    die("Error: {$result->name} - {$result->description}\n.");
}

var_dump($result->module_fields->sales_stage->options);
exit;

谢谢John,我不知道modulefieldone快速问题下的选项John,这个列表中的值(名称)是否在每次安装sugarcrm时都保持不变?是的。如果适用,它还将返回本地化字符串谢谢John,我不知道modulefieldone快速问题下的选项John,这个列表值(名称)是否在每次安装sugarcrm时都保持不变?是的。如果适用,它还将返回本地化字符串