• netsuite nlapiLineInit


    function nlapiValidateField(type, fld, optionswin, linenum)
    {
    var isValid = true;
    if (optionswin != null)
    optwin = optionswin;
    if (nsapiGetMainForm( ).elements.nlapiVF != null && nsapiGetMainForm( ).elements.nlapiVF.value.length > 0)
    {
    var fldnam = fld.name;
    if (linenum != null)
    fldnam = fldnam.substring(0,fldnam.length-linenum.toString().length)
    else if ( type != null )
    linenum = nlapiGetCurrentLineItemIndex(type)
    var scripts = nsapiGetMainForm( ).elements.nlapiVF.value.split(',');
    for ( var i = 0; isValid && i < scripts.length; i++ )
    {
    var checkValidOrig = fld.checkvalid
    try
    {
    fld.checkvalid = false;
    isValid = eval( scripts[ i ]+"(type, fldnam, linenum)" );
    }
    finally
    {
    fld.checkvalid = checkValidOrig;
    }
    if (!isValid)
    {
    if (typeof(ftabs) != 'undefined')
    {
    var tab = ftabs[fldnam.toLowerCase()];
    if (tab != null && tab != "main" && !isTabShown(tab))
    ShowTab(tab,true);
    }
    setFieldFocus( fld );
    if ( fld.select != null ) fld.select();
    optwin = null;
    }
    }
    }

    optwin = null;
    nsapiBuildChangedLineItems();
    return isValid;
    }
    function nlapiFieldChanged(type, fld, optionswin, linenum)
    {
    var fldnam = fld.name;
    if (linenum != null)
    fldnam = fldnam.substring(0,fldnam.length-linenum.toString().length)
    else if ( type != null )
    linenum = nlapiGetCurrentLineItemIndex(type)
    if (optionswin != null)
    optwin = optionswin;
    if (nsapiGetMainForm( ).elements.nlapiFC != null && nsapiGetMainForm( ).elements.nlapiFC.value.length > 0)
    {
    var scripts = nsapiGetMainForm( ).elements.nlapiFC.value.split(',');
    for ( var i = 0; i < scripts.length; i++ )
    eval(scripts[ i ]+"(type, fldnam, linenum)");
    }

    optwin = null;
    nsapiBuildChangedLineItems();
    }
    function nlapiPostSourcing(type, fldname)
    {
    if (nsapiGetMainForm( ).elements.nlapiPS != null && nsapiGetMainForm( ).elements.nlapiPS.value.length > 0)
    {
    var origflag = window.isinited;
    try
    { /* --- set inited flags so that machine calls function correctly. */
    setIsInited( window, true );
    var scripts = nsapiGetMainForm( ).elements.nlapiPS.value.split(',');
    for ( var i = 0; i < scripts.length; i++ )
    eval(scripts[ i ]+"(type, fldname)");
    }
    finally /* unset page_init flags. */
    {
    setIsInited( window, origflag );
    }
    }
    }
    function nlapiLineInit(type)
    {
    if (nsapiGetMainForm( ).elements.nlapiLI != null && nsapiGetMainForm( ).elements.nlapiLI.value.length > 0)
    {
    var scripts = nsapiGetMainForm( ).elements.nlapiLI.value.split(',');
    for ( var i = 0; i < scripts.length; i++ )
    eval(scripts[ i ]+"(type)");
    }
    }
    function nlapiValidateLine(type)
    {
    var isValid = true;
    if (nsapiGetMainForm( ).elements.nlapiVL != null && nsapiGetMainForm( ).elements.nlapiVL.value.length > 0)
    {
    var scripts = nsapiGetMainForm( ).elements.nlapiVL.value.split(',');
    for ( var i = 0; isValid && i < scripts.length; i++ )
    isValid = eval(scripts[ i ]+"(type)");
    }
    return isValid;
    }
    function nlapiRecalc(type)
    {
    if (nsapiGetMainForm( ).elements.nlapiRC != null && nsapiGetMainForm( ).elements.nlapiRC.value.length > 0)
    {
    var scripts = nsapiGetMainForm( ).elements.nlapiRC.value.split(',');
    for ( var i = 0; i < scripts.length; i++ )
    eval(scripts[ i ]+"(type)");
    }
    }

  • 相关阅读:
    设计模式--抽象工厂(个人笔记)
    C#中Trim()、TrimStart()、TrimEnd()的用法
    C#中String类的几个方法(IndexOf、LastIndexOf、Substring)
    枚举、字符串、值之间的转换
    C# 获取文件名、目录、后缀、无后缀文件名、扩展名、根目录等
    向服务器发送Post或Get请求(封装好的)
    未能加载文件或程序集“AspNetPager”或它的某一个依赖项。参数错误。 (异常来自 HRESULT:0x80070057 (E_INVALIDARG))
    Hibernate实现向数据库插入一条数据全过程(Study By Example)
    es6 模块化
    css3 属性认识
  • 原文地址:https://www.cnblogs.com/backuper/p/1432281.html
Copyright © 2020-2023  润新知