• Siebel Presumed Child Property Set


    Scripts presume the existence of a child property set. For example see the following code snippet

    function CheckAndImport()
    {. . .  . .
    bsAdapter.InvokeMethod("Query",vInputs,vOutputs);
    var vInMsg = vOutputs.GetChild(0);
    vInputs.Reset();
    vOutputs.Reset();
    vInputs.AddChild(vInMsg);    
    vInputs.SetProperty("MapName","Midea Price List Item Import");
    bsTransfer.InvokeMethod("Execute",vInputs,vOutputs);
    var vOutMsg = vOutputs.GetChild(0);
    . . . . . }

    This could lead to unhandled errors and corrupt data, since when an operation is performed on a nonexistent child, an error is thrown.

    Recommendation

    Ensure that the presence of the child property set is always checked by ensuring the GetChildCount() method of the parent returns a positive number.

    An example used in the scenario is based on the preceding code: BY DW

    function CheckAndImport()
    {. . .  . .
    bsAdapter.InvokeMethod("Query",vInputs,vOutputs);
    if(vOutputs.GetChildCount()>0)
    {
    var vInMsg = vOutputs.GetChild(0);
    vInputs.Reset();
    vOutputs.Reset();
    vInputs.AddChild(vInMsg);    
    vInputs.SetProperty("MapName","Midea Price List Item Import");
    bsTransfer.InvokeMethod("Execute",vInputs,vOutputs);
    var vOutMsg = vOutputs.GetChild(0);
    }
    . . . . . }
  • 相关阅读:
    MySQL 卸载
    Mysql(压缩包)下载与安装
    sqlserver一次性修改多条
    mysql一些操作
    SQL函数集合
    js时间转换相关
    easyui grid中翻页多选方法
    easyui combobox筛选(拼音)
    wpf图片切换,幻灯效果
    openfire搭建IM
  • 原文地址:https://www.cnblogs.com/Flamo/p/3977622.html
Copyright © 2020-2023  润新知