我想在网络客户端中使用名称传递路径变量。我可以通过键值对传递查询参数,但如何传递路径变量。
对于查询参数,我们可以通过传递键值对来做到这一点
this.webClient.get()
.uri(uriBuilder - > uriBuilder
.path("/products/")
.queryParam("name", "AndroidPhone")
.queryParam("color", "black")
.queryParam("deliveryDate", "13/04/2019")
.build())
.retrieve();
Run Code Online (Sandbox Code Playgroud)
对于路径变量,我们可以通过传递值来做到这一点
this.webClient.get()
.uri(uriBuilder - > uriBuilder
.path("/products/{id}/attributes/{attributeId}")
.build(2, 13))
.retrieve();
Run Code Online (Sandbox Code Playgroud)
我想要像下面这样
this.webClient.get()
.uri(uriBuilder - > uriBuilder
.path("/products/{id}/attributes/{attributeId}/")
.pathParam("attributeId", "AIPP-126")
.pathParam("id", "5254136")
.build())
.retrieve();
Run Code Online (Sandbox Code Playgroud) 我尝试使用PHP Toolkit通过帐户ID,用户名和密码访问Netsuite.我可以使用上述凭据获取客户详细信息.我有访问令牌.但是现在我尝试使用访问令牌访问Netsuite.我需要PHP代码才能使用令牌访问Netsuite,我想获取客户详细信息.
提前致谢
我试图使用RESTlet从Netsuite获取数据.为此,我在PHP中使用以下详细信息:
在第一次使用这些细节时,我得到的错误是无效的登录尝试.我发现它为什么会来,因为以下任何一个或所有错误的细节.
在给出正确的细节后,它工作正常,我将所有这些细节存储在DB中.我什么都没改变.但几天后我得到了同样的错误.
我想知道访问令牌是否会在几天后过期,或者为什么错误即将到来.
通过RESTlet创建电话通话活动时出现错误,即使我发送正确的格式也是如此。
Invalid date value (must be M/D/YYYY)
Run Code Online (Sandbox Code Playgroud)
它在Suitescript 1.0中正常工作。电话具有许多标准日期字段,也可以具有自定义日期字段。
如果需要在Restlet中将这些日期字段转换为可接受的格式,则需要标识所有日期和时间类型字段。
还有其他方法可以进行吗?
JSON格式
{
"title":"test",
"startdate":"01/08/2019",
"resourceType":"phonecall"
}
Run Code Online (Sandbox Code Playgroud)
在suitescript 1.0中工作正常
function post(datain) {
var record = nlapiCreateRecord(datain.resourceType);
for (var fieldname in datain) {
if (datain.hasOwnProperty(fieldname)) {
if (fieldname != 'resourceType' && fieldname != 'id') {
var value = datain[fieldname];
record.setFieldValue(fieldname, value);
}
}
}
var recordId = nlapiSubmitRecord(record);
nlapiLogExecution('DEBUG', 'id=' + recordId);
var nlobj = nlapiLoadRecord(datain.resourceType, recordId);
return nlobj;
}
Run Code Online (Sandbox Code Playgroud)
在Suitescript 2.0中不起作用
/**
*@NApiVersion 2.x
*@NScriptType Restlet
*/
define(['N/record'],function(record) {
function …Run Code Online (Sandbox Code Playgroud) 我可以通过下面的代码得到记录
record.load(recordType, id)
Run Code Online (Sandbox Code Playgroud)
对于上述功能,两个args都是必需的.
在netsuite suitescript 2.0中没有recordType单独使用id获取记录的任何方法?
我可以传递选择,文本框等的值,但不能用于多选.我可以更新多选的值.但我不能通过传递多选的值来创建记录.
这是代码:
$datastring = array(
"gu_action"=> "create",
"recordtype"=>"vendor",
"companyname"=>"Jerald Vend",
'subsidiary'=>1,
'custentity36'=>1
);
Run Code Online (Sandbox Code Playgroud)
custentity36是多选控制.它的标签是课程
当我通过单值时,它工作正常.当我尝试传递多个值的多个值时,如下面的代码,我收到错误,如"请输入值:课程"
$datastring = array(
"gu_action"=> "create",
"recordtype"=>"vendor",
"companyname"=>"Jerald Vend",
'subsidiary'=>1,
'custentity36'=>array(1,3)
);
Run Code Online (Sandbox Code Playgroud)
该守则是:https://gist.githubusercontent.com/ganeshprabhus/a3ebd67712913df3de29/raw/3a6df6a3af8642fceacb3a4b8e519ad96a054e69/ns_script.js