• nlapiGetContext 应用与介绍


    var currentContext = nlapiGetContext();

    var procId = currentContext.getSetting('SCRIPT',ncConst.BGP_ProcessIdParam);

    去读取这个值,难道这个值可以动态被设置?

    错了, 这个值不可以动态设置!这个Type:SCRIPT是UI级的手工在script地方设置,

    下面介绍取值的

    getSetting(type, name)
    Returns a system or script setting
    Important: SCRIPT is the only type supported in Client SuiteScript.

    Parameters
    ? type{string}[required] - The type of script/system setting. Possible values include:
    ? SCRIPT - script parameter (defined per script)
    ? SESSION - session variable (volatile setting defined per session)
    ? FEATURE - returns T (enabled) or F (disabled) depending on whether a feature is
    enabled. In the SuiteScript Reference Guide, see "Feature Names and IDs" o
    page 335 for all NetSuite feature names and internal IDs.
    ? PERMISSION - returns permission level: 0 (none), 1 (view), 2 (create), 3 (edit), 4
    (full). In the SuiteScript Reference Guide, see "Permission Names and IDs" o
    page 327 for all NetSuite permission IDs.
    ? name {string} [required]- The name of the script/system setting


    Important: You must use the nlobContext.getSetting method on nlapiGetContext to reference
    script parameters. For example, to obtain the value of a script parameter called
    custscript_case_field, you use the following code:
    nlapiGetContext().getSetting('SCRIPT', 'custscript_case_field')


    Returns
    ? If type is specified as SCRIPT, SESSION, or FEATURE, a string value is returned. If
    type is specified as PERMISSION, an integer value is returned.

    -------------------------------------------------------------------------------------------------

    下面介绍设置值的:

    setSetting(type, name, value)
    Sets the value of a script or user-defined setting. Only available in Server SuiteScript.
    ? type{string} [required] - The type of script/system setting
    ? SESSION - session variable (volatile setting defined per session)
    ? name{string} [required]- The name of the script/system setting
    ? value {string} [required]- The new value for the script/system setting
    Returns
    ? void

    所以我们可以知道设置时,仅支持设置SESSION类的东西,其他类不支持。

  • 相关阅读:
    3、spring注解注入
    2、spring注入のArrayList数组对象注入方式
    1、基本知识
    1、log4j的配置与使用
    3、在Eclipse中使用JUnit4进行单元测试(高级篇)
    2、在Eclipse中使用JUnit4进行单元测试(中级篇)
    1、JUnit4简介
    使用BroadcastReceiver实现系统对手机电量进行提示
    使用BroadcastReceiver监听系统接收的短信
    使用BroadcastReceiver实现开机自动运行的Service
  • 原文地址:https://www.cnblogs.com/backuper/p/1369527.html
Copyright © 2020-2023  润新知