zoukankan      html  css  js  c++  java
  • Siebel Performance for Script <1>

    1.Code in PreGetFieldValue, PreSetFieldValue, SetFieldValue, PreCanInvokeMethod, PreInvokeMethod and InvokeMethod event handlers has been placed outside the switch on FieldName/MethodName.

    Wrong Example:By DW

    function BusComp_SetFieldValue (FieldName)
    {. . . . .
    var boQuote = TheApplication().ActiveBusObject();
    var bcQuote = boQuote.GetBusComp("Quote");
    var nExchangeRate = bcQuote.GetFieldValue("Display Exchange Rate");
    var sCRMCurrencyCode = bcQuote.GetFieldValue("Currency Code");
    var nCommission = 0,nCRMCommission = 0,nCommmissionRate = 0;
    var nBudgetConRate =this.GetFieldValue("Conversion Rate");
    var nQuoteTotal = this.GetFieldValue("Quote Total");
    var sCurrencyCode = this.GetFieldValue("Currency Code");
    if(FieldName == "Commission"){
    . . . . . .    }

    Consequence

    These event handlers have meaning if related to a particular FieldName or MethodName passed as input by the infrastructure.

    Code places outside the switches on such variables will be executed for every field or method. This means that it will be unnecessarily executed a lot of times

    For example this is the list of methods invoked to display the Contact List Applet:

    PreCanInvokeMethod invoked DeleteRecord
    PreCanInvokeMethod invoked ShowQueryAssistant
    PreCanInvokeMethod invoked ToggleListRowCount
    PreCanInvokeMethod invoked UndoQuery
    PreCanInvokeMethod invoked ExecuteQuery
    PreCanInvokeMethod invoked GotoNextSet
    PreCanInvokeMethod invoked GotoPreviousSet
    PreCanInvokeMethod invoked NewQuery
    PreCanInvokeMethod invoked NewRecord
    PreCanInvokeMethod invoked PositionOnRow
    PreCanInvokeMethod invoked UndoQuery
    PreCanInvokeMethod invoked UndoRecord
    PreCanInvokeMethod invoked WriteRecord
    PreCanInvokeMethod invoked ShowPopup
    PreCanInvokeMethod invoked ToggleLayout
    PreCanInvokeMethod invoked GetBookmarkURL
    PreCanInvokeMethod invoked FileSendMail
    PreCanInvokeMethod invoked FileSendFax
    PreCanInvokeMethod invoked FileSendPage
    PreCanInvokeMethod invoked FileSendWireless
    PreCanInvokeMethod invoked Import
    PreCanInvokeMethod invoked ExportQuery
    PreCanInvokeMethod invoked CopyRecord
    PreCanInvokeMethod invoked ChangeRecords
    PreCanInvokeMethod invoked MergeRecords
    PreCanInvokeMethod invoked SelectAll
    PreCanInvokeMethod invoked InvertSelection
    PreCanInvokeMethod invoked ColumnsDisplayed
    PreCanInvokeMethod invoked GotoPrevious
    PreCanInvokeMethod invoked GotoNext
    PreCanInvokeMethod invoked GotoFirstSet
    PreCanInvokeMethod invoked GotoLastSet
    PreCanInvokeMethod invoked RefineQuery
    PreCanInvokeMethod invoked AboutRecord
    PreCanInvokeMethod invoked EditPopup
    PreCanInvokeMethod invoked ExecuteReply
    PreCanInvokeMethod invoked ExecuteReplyAll
    PreCanInvokeMethod invoked ExecuteForward
    PreCanInvokeMethod invoked EmailSend
    PreCanInvokeMethod invoked EmailCancel
    PreCanInvokeMethod invoked RecordCount
    PreCanInvokeMethod invoked AddToSyncList
    PreCanInvokeMethod invoked RemoveFromSyncList
    PreCanInvokeMethod invoked SynchContact
    PreCanInvokeMethod invoked NewOrder
    PreCanInvokeMethod invoked NewQuote
    PreCanInvokeMethod invoked SortOrder
    PreCanInvokeMethod invoked GotoApplet

    If an object allocation, a BC query, a call to CountRecords is placed outside the switch, it will be executed unnecessarily more than 40 times only at applet load. This may result in a sub-optimal performance.

    Solution

    Place all the code in these event handlers inside the switch on method or field name.

    Only variable declaration (not allocation) should be places outside.

    function BusComp_SetFieldValue (FieldName)
    {. . . . .
    if(FieldName == "Commission"){
    var boQuote = TheApplication().ActiveBusObject();
    var bcQuote = boQuote.GetBusComp("Quote");
    var nExchangeRate = bcQuote.GetFieldValue("Display Exchange Rate");
    var sCRMCurrencyCode = bcQuote.GetFieldValue("Currency Code");
    var nCommission = 0,nCRMCommission = 0,nCommmissionRate = 0;
    var nBudgetConRate =this.GetFieldValue("Conversion Rate");
    var nQuoteTotal = this.GetFieldValue("Quote Total");
    var sCurrencyCode = this.GetFieldValue("Currency Code");
    . . . . . .    }
  • 相关阅读:
    《控制系统设计指南》第三章控制系统的调试读书笔记(二)
    机电传动控制第三周学习笔记
    PLECS软件学习使用(三)第三周仿真与计算作业
    PLECS软件学习使用(二)直流电机基本系统模型
    《控制系统设计指南》第一章和第二章读书笔记(一)
    《自动化技术中的进给电气传动》第一章的1.3节读书笔记(二)
    机电传动控制第二周学习笔记
    《实时控制软件设计》第一周作业 欧梓峰 U201317662 (更新)
    K3 查询收集
    K3 12.3应付收集
  • 原文地址:https://www.cnblogs.com/Flamo/p/3977666.html
Copyright © 2011-2022 走看看