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");
. . . . . .    }
时间: 2024-10-09 01:36:09

Siebel Performance for Script <1>的相关文章

Performance --- 前端性能监控

阅读目录 一:什么是Performance? 二:使用 performance.timing 来计算值 三:前端性能如何优化? 四:Performance中方法 五:使用performane编写小工具 回到顶部 一:什么是Performance? Performance是前端性能监控的API.它可以检测页面中的性能,W3C性能小组引入进来的一个新的API,它可以检测到白屏时间.首屏时间.用户可操作的时间节点,页面总下载的时间.DNS查询的时间.TCP链接的时间等.因此我们下面来学习下这个API.

Netperf Manual

Netperf Manual Section 0. The Legal Stuff Section 1. Introduction Conventions and Definitions Section 2. Installing Netperf Getting the netperf bits from the Internet Installing the bits Verifying the bits Running netserver as a standalone Daemon Fin

web计时机制

前面的话 页面性能一直都是Web开发人员比较关注的领域.但在实际应用中,度量页面性能的指标,是javascript的Date对象.Web Timing API改变了这个局面,让开发人员通过javascript就能使用浏览器内部的度量结果,给出了页面加载和渲染过程的很多信息,对性能优化非常有价值.本文将详细介绍web Timing API--performance对象 简述 Web计时机制的核心是window.performance对象.对页面的所有度量信息,包括那些规范中已经定义的和将来才能确定

测开之路七十六:性能测试蓝图之html

<!-- 继承base模板 -->{% extends 'base.html' %} {% block script %} <!-- 从cdn引入ace edter的js --> <script src="https://cdn.bootcss.com/ace/1.4.5/ace.js"></script> <script src="https://cdn.bootcss.com/ace/1.4.5/mode-python

优化脚本性能 Optimizing Script Performance

This page gives some general hints for improving script performance on iOS. 此页面提供了一些一般的技巧,提高了在iOS上的脚本性能. Reduce Fixed Delta Time 减少固定的增量时间 Use a fixed delta time value between 0.04 and 0.067 seconds (ie, 15-25 frames per second). You can change this

Send email alert from Performance Monitor using PowerShell script (检测windows服务器的cpu 硬盘 服务等性能,发email的方法) -摘自网络

I have created an alert in Performance Monitor (Windows Server 2008 R2) that should be triggered whenever \Processor(_Total)\% Processor Time is Above 10 (a small value just to guarantee that the condition for sending the alert is always met). You ca

Siebel script for Pre Events

Pre events should only be used for data validation, not manipulation. such as PreSetFieldValue, PreDeleteRecord and PreWriteRecord function BusComp_PreWriteRecord () {. . . . . . var cost = GetFieldValue("Cost Price"); var price = GetFieldValue(

Microsoft.SQL.Server2012.Performance.Tuning.Cookbook学习笔记(一)

一.Creating a trace or workload 注意点: In the Trace Properties dialog box, there is a checkbox option in the General tab with the caption Server processes trace data, to specify whethertrace data should be processed on the server. If not checked, trace

Unity3D Optimizing Graphics Performance for iOS

原地址:http://blog.sina.com.cn/s/blog_72b936d801013ptr.html icense Comparisons http://unity3d.com/unity/licenses#iphone Optimizing Graphics Performance http://unity3d.com/support/documentation/Manual/Optimizing Graphics Performance.html iOS A useful bac