如何从net suite suitelet

时间:2016-07-28 14:03:54

标签: netsuite

任何人都可以告诉或分享如何通过传递参数来调用套件中的用户事件脚本或预定脚本的代码片段。我有一个包含所有记录的套件,每个记录我都有复选框作为前缀,一旦套件加载,用户可以通过选中每个复选框来选择记录,然后单击我需要传递的提交按钮选定的脚本值(可以是用户事件脚本或预定脚本)。任何建议都非常感谢。提前谢谢。

3 个答案:

答案 0 :(得分:1)

您可以使用nlapiScheduleScript()将参数作为对象传递给Scheduled Script并将其放入调度队列。

您需要在NetSuite的脚本记录中定义参数。您可以查看NetSuite中的“调度API”帮助文章,以获取更强大的文档(或查看SuiteAnswers文章10279)。

nlapiScheduleScript的语法是:

match_parent

答案 1 :(得分:0)

除了创建/更新/删除记录本身之外,没有明确的方法从计划脚本触发用户事件脚本,除了通过更新/设置记录本身的字段值之外,您无法传递参数。

就像@morethanawesome所说,您可以使用<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:id="@+id/imageView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="New Button" android:id="@+id/button" android:layout_alignParentTop="true" android:layout_alignParentStart="true" /> </RelativeLayout> 触发计划脚本并将参数传递给它。

答案 2 :(得分:0)

无法从预定脚本调用用户事件脚本,但是当您在创建或使用nlapiSubmitRecord编辑现有记录后提交记录时,将执行该记录的Usre-Event。

所以,使用这种方式你可以调用,否则使用API​​无法做到这一点。

谢谢, Mayur