Netsuite getAttribute会抛出错误

时间:2014-04-25 17:12:02

标签: javascript netsuite getattribute

我想要完成的是从传递给getAttribute的内部ID获取项目信息,但是我收到以下错误。

Error processing dynamic tag getAttribute('item',362,'storedisplayname') : id paramter 2 must be an integer

以下是代码示例:

var itemIntId = 362;
var id = "<%=getAttribute('item',"+itemIntId+",'storedisplayname')%>";
console.log("ID: " + id);

执行以下操作似乎没有任何改变,因为它仍然给我相同的错误

var id = "<%=declareAttribute('item',"+itemIntId+",'storedisplayname')%>";
console.log("ID: " + id);

这是在演示文稿标签页中,在Netsuite帮助部分中找到了以下信息

  “演示文稿”选项卡上的

getAttribute标记抛出错误有时使用   Presentation选项卡中的getAttribute()标记可能会抛出错误%u2018Error   处理动态标记getAttribute(&#39; item&#39;,9047,&#39; storeurl&#39;)%u2018。在   在这种情况下,您必须使用declareAttribute()来显示嵌入式   在演示文稿选项卡上标记。在“演示文稿”选项卡上&gt;元标记HTML   区域,只需添加:

<%=declareAttribute('item',9047,'storeurl')%>

但似乎没有帮助

我确定我只是错过了一些简单的事情,但是我已经把头撞在桌子上几个小时了,现在试图解决这个问题

1 个答案:

答案 0 :(得分:0)

在与Netsuite支持人员交谈并在代码上来回看之后,似乎getAttribute或declareAttribute不能从JavaScript中获取动态变量。不知道为什么它仍然是一个int,但我猜它就是它。