zoukankan      html  css  js  c++  java
  • 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类的东西,其他类不支持。

  • 相关阅读:
    谈谈最近求职的那些事
    新的一年你该如何起飞
    JavaScript原型链和instanceof运算符的暧昧关系
    (译)详解javascript立即执行函数表达式(IIFE)
    一道有意思的笔试题引发的对于new操作符的思考
    javascript中prototype、constructor以及__proto__之间的三角关系
    这10道javascript笔试题你都会么
    汤姆大叔的6道javascript编程题题解
    打字机游戏Ⅱ之手速pk
    css3实践之摩天轮式图片轮播+3D正方体+3D标签云(perspective、transform-style、perspective-origin)
  • 原文地址:https://www.cnblogs.com/backuper/p/1369527.html
Copyright © 2011-2022 走看看