博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Siebel Performance for Script <1>
阅读量:7121 次
发布时间:2019-06-28

本文共 3955 字,大约阅读时间需要 13 分钟。

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 DeleteRecordPreCanInvokeMethod invoked ShowQueryAssistantPreCanInvokeMethod invoked ToggleListRowCountPreCanInvokeMethod invoked UndoQueryPreCanInvokeMethod invoked ExecuteQueryPreCanInvokeMethod invoked GotoNextSetPreCanInvokeMethod invoked GotoPreviousSetPreCanInvokeMethod invoked NewQueryPreCanInvokeMethod invoked NewRecordPreCanInvokeMethod invoked PositionOnRowPreCanInvokeMethod invoked UndoQueryPreCanInvokeMethod invoked UndoRecordPreCanInvokeMethod invoked WriteRecordPreCanInvokeMethod invoked ShowPopupPreCanInvokeMethod invoked ToggleLayoutPreCanInvokeMethod invoked GetBookmarkURLPreCanInvokeMethod invoked FileSendMailPreCanInvokeMethod invoked FileSendFaxPreCanInvokeMethod invoked FileSendPagePreCanInvokeMethod invoked FileSendWirelessPreCanInvokeMethod invoked ImportPreCanInvokeMethod invoked ExportQueryPreCanInvokeMethod invoked CopyRecordPreCanInvokeMethod invoked ChangeRecordsPreCanInvokeMethod invoked MergeRecordsPreCanInvokeMethod invoked SelectAllPreCanInvokeMethod invoked InvertSelectionPreCanInvokeMethod invoked ColumnsDisplayedPreCanInvokeMethod invoked GotoPreviousPreCanInvokeMethod invoked GotoNextPreCanInvokeMethod invoked GotoFirstSetPreCanInvokeMethod invoked GotoLastSetPreCanInvokeMethod invoked RefineQueryPreCanInvokeMethod invoked AboutRecordPreCanInvokeMethod invoked EditPopupPreCanInvokeMethod invoked ExecuteReplyPreCanInvokeMethod invoked ExecuteReplyAllPreCanInvokeMethod invoked ExecuteForwardPreCanInvokeMethod invoked EmailSendPreCanInvokeMethod invoked EmailCancelPreCanInvokeMethod invoked RecordCountPreCanInvokeMethod invoked AddToSyncListPreCanInvokeMethod invoked RemoveFromSyncListPreCanInvokeMethod invoked SynchContactPreCanInvokeMethod invoked NewOrderPreCanInvokeMethod invoked NewQuotePreCanInvokeMethod invoked SortOrderPreCanInvokeMethod 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");. . . . . .    }

 

转载于:https://www.cnblogs.com/Flamo/p/3977666.html

你可能感兴趣的文章
React Hooks 梳理
查看>>
垃圾回收之引用计数
查看>>
Java的Interrupt与线程中断
查看>>
前端实用小工具
查看>>
大型云原生项目在数字化企业落地过程解密
查看>>
CentOS 7 编译安装 PHP 7
查看>>
vue跳转传参刷新后参数消失
查看>>
Java™ 教程(原子变量)
查看>>
非对称加密算法--RSA加密原理及运用
查看>>
精读《如何编译前端项目与组件》
查看>>
[ 逻辑锻炼] 用 JavaScript 做一个小游戏 ——2048 (详解版)
查看>>
【产品】产品经理常用的五大分析法
查看>>
Javascript二进制运算符的一些运用场景
查看>>
常见Promise面试题
查看>>
一个专科生学习JAVA目标月薪2万是否不切实际?
查看>>
保持ssh的连接不断开
查看>>
Java 高级算法——数组中查询重复的数字之二
查看>>
897-递增顺序查找树
查看>>
nginx配置后重启无效与重启失败
查看>>
【笔记】JavaScript高级篇——面向对象、原型、继承
查看>>