如何使用SuiteTalk API获取所有促销?

时间:2016-05-30 03:10:55

标签: php netsuite promotions suitetalk

我正在使用suitetalk工具包访问Netsuite。已经检查了samplecode,它有代码通过其内部Id获取促销详细信息(使用getCustomer.php)。我想从netsuite获得所有促销,以实现这可能是最好的方式,我该怎么做?

已经尝试了一些hacks,比如通过savedsearch,搜索结果,通过提供促销作为字符串。他们都没有让我成功。

任何人都可以帮我找到路吗?我无法看到任何文档或在线页面与我的要求一起使用suitetalk操作。

代码我试图获得促销

$service = new NetSuiteService();
$request = new GetRequest();
$request->baseRef = new RecordRef();
$request->baseRef->internalId = "3";//3183723
$request->baseRef->type = "promotionCode";//customer
$getResponse = $service->get($request);
print_r($getResponse);

if (!$getResponse->readResponse->status->isSuccess) {
    echo "GET ERROR";
} else {
    $promotion = $getResponse->readResponse->record;
    echo "Name :".$promotion->name."\n";
    echo "Start Date :".$promotion->startDate."\n";
    echo "End Date :".$promotion->endDate."\n";
    echo "Description :".$promotion->description."\n";
    echo "Rate :".$promotion->rate."\n";
}

1 个答案:

答案 0 :(得分:0)

使用搜索电话,而不是来电。搜索将返回所有分页行。