首页 > 代码库 > Siebel Presumed Child Property Set
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);}. . . . . }
Siebel Presumed Child Property Set
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。