• netsuite 批次货品 lotnumber 到期日/批号 列的赋值


    在弹出的搜索页面,确认输入的批号时,

    函数的调用依次是:

    setTarget('21/2/2009-269852',21/2/2009-269852);

    function setTarget(s,i) {
    var frm,fldnam,fld;
    frm = parent.opener.document.forms.item_form;
    fldnam = 'serialnumbers';
    fld = parent.opener.getFormElement(frm,fldnam);
    addMultiSelectValue(fld,i,s);
    window.opener.setTimeout(function() { fld.onchange(); }, 0);;
    }

    所有批号的赋值关键就在这个addMultiSelectValue(fld,i,s);中,我们接着来看:

    function addMultiSelectValue(sel, val, name)
    {
    if (isNLMultiDropDown(sel))
    {
    var dd = getMultiDropdown(sel);
    var idx = dd.getIndexForValue(val);
    dd.addIndex(idx);
    }
    else if (sel.type == "select-multiple")
    {
    var opts = sel.options;
    for (var i=0; i < opts.length; i++)
    if ( opts[i].value == val )
    opts[i].selected = true;
    }
    else
    {
    var values = sel.value.split(String.fromCharCode(5));
    for (var i=0;i < values.length;i++)
    if (values[i] == val) return;
    sel.form.elements[sel.name+"_display"].style.color = '000000';
    if (values.length == 0 || values[0].length == 0)
    {
    sel.value = val;
    sel.form.elements[sel.name+"_display"].value = name;
    sel.form.elements[sel.name+"_labels"].value = name;
    }
    else
    {
    sel.value += String.fromCharCode(5)+val;
    sel.form.elements[sel.name+"_labels"].value += String.fromCharCode(5)+name;
    var lines = sel.form.elements[sel.name+"_display"].value.split(/\n|\r/);
    if (lines.length == values.length)
    sel.form.elements[sel.name+"_display"].value += "\n"+name;
    else
    {
    lines[values.length] = name;
    sel.form.elements[sel.name+"_display"].value = lines.join("\n");
    }
    }
    }
    }

    总结:document.item_form.elements['serialnumbers_display'].value='21/2/2009-269852'; 即可完成批号的批量赋值。。。

    当然:Syncserialnumbers(true);
    nlapiFieldChanged('item',this);
    validateInventoryNumbers(); 可不能忘记罗。。。

    同样学到一点 ,如果elements 没有id 的话,用默认的 getElementById是取不到值的,在firefox下是这样的。所有系统被迫用了sel.form.elements[sel.name+"_display"].value 去赋值了。

    zeng.cz

    ==================================================================由于SO中的lotnumber的序列号列中所有填写的数量,受到SO界面中Location的影响,所以抓到的东西必须是过滤后的东西,而货品的编辑页面(https://system.netsuite.com/app/common/item/item.nl?id=42)的SubTab(numbers)有两个filter,

    一个是Synconhandfilter 另一个是Synclocationfilter ,所以现在取得这两个东西过滤后的东西 成为必须和关键要素。200901071758

    To Be Continued....

    +

    that's the page we need to catch : https://system.netsuite.com/app/common/item/item.nl?itemtype=InvtPart&costingmethod=LOT&cf=7&id='+itemid+'&q=locationfilter&si='+location+'&si_onhandfilter=onhand&f=T&machine=numbers'

    itemid is the item's internalId ; and location is the location's InternalId;

    ok it' come to more easyer...

  • 相关阅读:
    剑指offer题解(python版)(更新到第16题)
    Java基础知识详解:值传递
    [LeetCode] 583. Delete Operation for Two Strings
    [LeetCode] 856. Score of Parentheses
    [LeetCode] 1129. Shortest Path with Alternating Colors
    [LeetCode] 1561. Maximum Number of Coins You Can Get
    [LeetCode] 1052. Grumpy Bookstore Owner
    [LeetCode] 991. Broken Calculator
    [LeetCode] 1054. Distant Barcodes
    [LeetCode] 1245. Tree Diameter
  • 原文地址:https://www.cnblogs.com/backuper/p/1370952.html
Copyright © 2020-2023  润新知