【问题标题】:How to pass notedate for User Notes in Netsuite using RESTlet?如何使用 RESTlet 在 Netsuite 中为用户注释传递注释?
【发布时间】:2020-09-12 06:34:56
【问题描述】:

我可以在 Netsuite 中为客户创建和更新用户注释。 以下数据运行良好。

$columns_field= array("title","direction","notedate"); #_scheduled
$columns_values=array("Sample User Notes","2","4/30/2016");
$datastring = array('recordtype' => 'note', 'id' => '104','columnname' =>$columns_field,'columnvalues'=>$columns_values,'gu_action'=>'update');

但是当我为 noteate 添加时间时,它将不起作用。我想传递日期和时间。这些格式我都试过了。

喜欢

  1. 2016 年 4 月 30 日上午 05:06
  2. 2016 年 4 月 30 日上午 05:06
  3. 2016 年 4 月 30 日 14:32

我在以下链接中有 RESTlet 文件: https://gist.githubusercontent.com/ganeshprabhus/68a9e5b81e53436bb1d684f857a6c31f/raw/67fe03895f1c31d65c1f283dd51584af45d27c59/NS_Script_2016.2004.

我的参考链接是: https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2015_2/schema/record/note.html

附加要求: 如果可能,请发布参考链接。

【问题讨论】:

    标签: netsuite


    【解决方案1】:

    对于注释记录,日期和时间是单独的字段。它们的脚本 ID 分别是“notedate”和“time”。

    所以如果你有一个真实的日期:

    note.setFieldValue("notedate", nlapiDateToString(datetime)); //'date' format i s the default
    note.setFieldValue("time" , nlapiDateToString(datetime, 'timeofday'));
    

    【讨论】:

    【解决方案2】:

    尝试"2015-03-25T12:00:00" 作为您的日期字符串。这是 Javascript Date 对象可以理解的格式,这是您最终在 NetSuite 中使用的格式(实际上是 Rhino + Java,但足够接近)

    顺便说一句,上面的 T 代表 UTC 时间,所以请务必牢记这一点。

    【讨论】:

    • 我一直很好奇NS背后的JS引擎是什么。我想知道它是否会过渡到现代引擎。
    猜你喜欢
    • 2016-04-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多