Nesuite PHP自定义记录 [英] Nesuite PHP Custom Record
问题描述
我已经下载了Netsuite的2012_2 PHP工具包.如果文档很少或没有文档,那么如果有人可以让我掌握如何连接到Netsuite中创建的自定义记录列表的经验,那就太好了
I have downloaded 2012_2 PHP Toolkit for Netsuite. With less or no documentation it would be great if someone can give me headstart on how to connect to a Custom Record List Created in Netsuite
列表是netsuite中list-> support下的实验室.
The list is labs under lists->support in netsuite.
通过PHP我想将数据输入到该列表中,我不需要完整的代码,我只需要在如何连接到我在netsuite中创建的自定义记录上获得先机即可.我在netsuite中有自定义记录的内部ID和自定义记录的名称.
Through PHP i want to enter data to that list I dont need the entire code, I just need a headstart on how to connect to that custom record I created in netsuite. I have the internal id of the custom record and the name of the custom record in netsuite.
推荐答案
以下是有关如何使用PHP Toolkit 2012.2为自定义记录类型添加新记录的示例代码.
Below is a sample code on how to add new record for a custom record type using PHP Toolkit 2012.2
//create an instance of the fields of the custom record
$customFieldList = new StringCustomFieldRef();
$customFieldList->internalId = "custrecord_name";
$customFieldList->value = "Test from PHP toolkit";
$basicCustomRecord = new CustomRecord();
$basicCustomRecord->name = "PHP Toolkit 2012.2";
$basicCustomRecord->recType = new RecordRef();
$basicCustomRecord->recType->internalId = "14"; //Record Type's internal ID (Setup > Customization > Record Types > Basic Record Type (Internal ID=14)
$basicCustomRecord->customFieldList = new CustomFieldList();
$basicCustomRecord->customFieldList->customField = $customFieldList;
$addRequest = new AddRequest();
$addRequest->record = $basicCustomRecord;
$addResponse = $service->add($addRequest);
if (!$addResponse->writeResponse->status->isSuccess) { echo "ADD ERROR"; exit();}
else { echo "ADD SUCCESS, id " . $addResponse->writeResponse->baseRef->internalId;}
?>
SuiteAnswers中提供了相同的代码. SuiteAnswers中还提供了许多其他PHP工具包2012.2示例代码.如果有时间,您可以查看这些代码以供将来参考.
this same code is available in SuiteAnswers. There are a number of other sample codes for PHP Toolkit 2012.2 in SuiteAnswers as well. If you have time, you can review those code for your future reference.
致谢!
这篇关于Nesuite PHP自定义记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!